diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 00000000..f2ec5d1c --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json", + "changelog": [ + "@changesets/changelog-github", + { "repo": "roikoren755/eslint-plugin-es" } + ], + "commit": false, + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.commitlintrc.js b/.commitlintrc.js new file mode 100644 index 00000000..422b1944 --- /dev/null +++ b/.commitlintrc.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] }; diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..10998f50 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +tests/fixtures +coverage/ diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..db1a23fb --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,239 @@ +const ERROR = 2; +const WARN = 1; +const OFF = 0; + +module.exports = { + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig.json'], + ecmaVersion: 6, + jsxPragma: null, + }, + reportUnusedDisableDirectives: true, + plugins: ['import'], + settings: { + 'import/parsers': { '@typescript-eslint/parser': ['.ts'] }, + 'import/resolver': { node: { extensions: ['.ts', '.js', '.json'] }, typescript: {} }, + }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:import/errors', + 'plugin:unicorn/recommended', + 'plugin:prettier/recommended', + 'plugin:eslint-plugin/all', + ], + rules: { + 'array-callback-return': ERROR, + 'arrow-body-style': ERROR, + 'consistent-return': [WARN, { treatUndefinedAsUnspecified: true }], + curly: ERROR, + 'default-case': ERROR, + eqeqeq: ERROR, + 'guard-for-in': WARN, + 'lines-between-class-members': ERROR, + 'max-lines': ERROR, + 'no-bitwise': ERROR, + 'no-caller': ERROR, + 'no-case-declarations': OFF, + 'no-console': WARN, + 'no-constructor-return': ERROR, + 'no-continue': WARN, + 'no-else-return': ERROR, + 'no-eval': ERROR, + 'no-extend-native': ERROR, + 'no-extra-bind': ERROR, + 'no-floating-decimal': ERROR, + 'no-implicit-coercion': [ERROR, { allow: ['!!'] }], + 'no-invalid-this': WARN, + 'no-iterator': ERROR, + 'no-lone-blocks': ERROR, + 'no-lonely-if': ERROR, + 'no-loop-func': ERROR, + 'no-multi-assign': ERROR, + 'no-nested-ternary': ERROR, + 'no-new': ERROR, + 'no-new-func': ERROR, + 'no-new-wrappers': ERROR, + 'no-param-reassign': ERROR, + 'no-path-concat': ERROR, + 'no-plusplus': [ERROR, { allowForLoopAfterthoughts: true }], + 'no-process-exit': OFF, + 'no-proto': ERROR, + 'no-return-assign': ERROR, + 'no-script-url': ERROR, + 'no-self-compare': ERROR, + 'no-shadow': ERROR, + 'no-template-curly-in-string': ERROR, + 'no-undef-init': ERROR, + 'no-underscore-dangle': [WARN, { allowAfterThis: true, allowAfterSuper: true }], + 'no-unmodified-loop-condition': ERROR, + 'no-unneeded-ternary': [ERROR, { defaultAssignment: false }], + 'no-useless-call': ERROR, + 'no-useless-computed-key': ERROR, + 'no-useless-concat': ERROR, + 'no-useless-return': ERROR, + 'no-void': ERROR, + 'object-shorthand': ERROR, + 'one-var': [ERROR, 'never'], + 'operator-assignment': ERROR, + 'padding-line-between-statements': [ + ERROR, + // Always require blank lines after directive (like 'use-strict'), except between directives + { blankLine: 'always', prev: 'directive', next: '*' }, + { blankLine: 'any', prev: 'directive', next: 'directive' }, + // Always require blank lines after import, except between imports + { blankLine: 'always', prev: 'import', next: '*' }, + { blankLine: 'any', prev: 'import', next: 'import' }, + // Always require blank lines before and after every sequence of variable declarations and export + { blankLine: 'always', prev: '*', next: ['const', 'let', 'var', 'export'] }, + { blankLine: 'always', prev: ['const', 'let', 'var', 'export'], next: '*' }, + { blankLine: 'any', prev: ['const', 'let', 'var', 'export'], next: ['const', 'let', 'var', 'export'] }, + // Always require blank lines before and after class declaration, if, do/while, switch, try + { blankLine: 'always', prev: '*', next: ['if', 'class', 'for', 'do', 'while', 'switch', 'try'] }, + { blankLine: 'always', prev: ['if', 'class', 'for', 'do', 'while', 'switch', 'try'], next: '*' }, + // Always require blank lines before return statements + { blankLine: 'always', prev: '*', next: 'return' }, + ], + 'prefer-destructuring': ERROR, + 'prefer-exponentiation-operator': ERROR, + 'prefer-numeric-literals': ERROR, + 'prefer-promise-reject-errors': ERROR, + 'prefer-regex-literals': ERROR, + 'prefer-template': ERROR, + 'quote-props': [ERROR, 'as-needed'], + radix: ERROR, + 'spaced-comment': ERROR, + 'sort-imports': [ERROR, { ignoreDeclarationSort: true }], + strict: ERROR, + yoda: ERROR, + + '@typescript-eslint/array-type': ERROR, + '@typescript-eslint/ban-ts-comment': [ERROR, { 'ts-expect-error': false }], + '@typescript-eslint/ban-ts-ignore': OFF, + '@typescript-eslint/ban-types': WARN, + '@typescript-eslint/camelcase': OFF, + '@typescript-eslint/consistent-indexed-object-style': ERROR, + '@typescript-eslint/consistent-type-definitions': ERROR, + '@typescript-eslint/consistent-type-imports': ERROR, + '@typescript-eslint/class-literal-property-style': ERROR, + '@typescript-eslint/default-param-last': ERROR, + '@typescript-eslint/explicit-function-return-type': [ERROR, { allowExpressions: true }], + '@typescript-eslint/explicit-member-accessibility': [ERROR, { accessibility: 'no-public' }], + '@typescript-eslint/explicit-module-boundary-types': WARN, + '@typescript-eslint/interface-name-prefix': OFF, + '@typescript-eslint/method-signature-style': [ERROR, 'method'], + '@typescript-eslint/no-empty-function': WARN, + '@typescript-eslint/no-empty-interface': [WARN, { allowSingleExtends: true }], + '@typescript-eslint/no-extra-non-null-assertion': ERROR, + '@typescript-eslint/no-extraneous-class': ERROR, + '@typescript-eslint/no-invalid-void-type': ERROR, + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': ERROR, + '@typescript-eslint/no-non-null-asserted-optional-chain': ERROR, + '@typescript-eslint/no-parameter-properties': ERROR, + '@typescript-eslint/no-unused-expressions': [ERROR, { allowTernary: true }], + '@typescript-eslint/no-unused-vars': [ERROR, { ignoreRestSiblings: true }], + '@typescript-eslint/no-use-before-define': WARN, + '@typescript-eslint/no-useless-constructor': ERROR, + '@typescript-eslint/no-var-requires': WARN, + '@typescript-eslint/prefer-as-const': ERROR, + '@typescript-eslint/prefer-for-of': ERROR, + '@typescript-eslint/prefer-function-type': ERROR, + '@typescript-eslint/prefer-optional-chain': WARN, + '@typescript-eslint/prefer-ts-expect-error': ERROR, + '@typescript-eslint/sort-type-union-intersection-members': ERROR, + '@typescript-eslint/unified-signatures': ERROR, + + '@typescript-eslint/consistent-type-exports': ERROR, + '@typescript-eslint/dot-notation': ERROR, + '@typescript-eslint/naming-convention': [ + ERROR, + { + selector: 'property', + format: ['camelCase', 'UPPER_CASE', 'PascalCase'], + leadingUnderscore: 'allow', + filter: { regex: '^process\\.env\\.[A-Z][A-Z_]*$', match: false }, + }, + { selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'], leadingUnderscore: 'allow' }, + { selector: 'typeLike', format: ['PascalCase'] }, + { selector: 'typeAlias', format: ['PascalCase'], custom: { regex: '^I[A-Z]', match: false } }, + { selector: 'interface', format: ['PascalCase'], prefix: ['I'] }, + ], + '@typescript-eslint/no-base-to-string': ERROR, + '@typescript-eslint/no-confusing-void-expression': ERROR, + '@typescript-eslint/no-floating-promises': WARN, + '@typescript-eslint/no-implied-eval': ERROR, + '@typescript-eslint/no-meaningless-void-operator': [ERROR, { checkNever: false }], + '@typescript-eslint/no-throw-literal': ERROR, + '@typescript-eslint/no-unnecessary-boolean-literal-compare': ERROR, + '@typescript-eslint/no-unnecessary-type-arguments': ERROR, + '@typescript-eslint/no-unsafe-argument': WARN, + '@typescript-eslint/no-unsafe-assignment': WARN, + '@typescript-eslint/no-unsafe-call': WARN, + '@typescript-eslint/no-unsafe-member-access': WARN, + '@typescript-eslint/no-unsafe-return': WARN, + '@typescript-eslint/prefer-nullish-coalescing': WARN, + '@typescript-eslint/prefer-readonly': ERROR, + '@typescript-eslint/prefer-reduce-type-parameter': ERROR, + '@typescript-eslint/prefer-regexp-exec': WARN, + '@typescript-eslint/prefer-return-this-type': ERROR, + '@typescript-eslint/require-array-sort-compare': ERROR, + '@typescript-eslint/require-await': ERROR, + '@typescript-eslint/restrict-template-expressions': WARN, + '@typescript-eslint/return-await': [ERROR, 'in-try-catch'], + '@typescript-eslint/switch-exhaustiveness-check': ERROR, + '@typescript-eslint/unbound-method': WARN, + + 'eslint-plugin/require-meta-docs-url': OFF, + + 'import/extensions': [ERROR, { json: 'always' }], + 'import/first': ERROR, + 'import/named': OFF, + 'import/namespace': OFF, + 'import/newline-after-import': ERROR, + 'import/no-cycle': WARN, + 'import/no-default-export': ERROR, + 'import/no-extraneous-dependencies': ERROR, + 'import/no-unresolved': WARN, + 'import/no-useless-path-segments': ERROR, + 'import/order': [OFF, { groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'] }], + + 'unicorn/better-regex': WARN, + 'unicorn/catch-error-name': OFF, + 'unicorn/consistent-function-scoping': OFF, + 'unicorn/explicit-length-check': WARN, + 'unicorn/filename-case': WARN, + 'unicorn/import-index': WARN, + 'unicorn/import-style': WARN, + 'unicorn/no-array-for-each': OFF, + 'unicorn/no-array-reduce': OFF, + 'unicorn/no-array-callback-reference': WARN, + 'unicorn/no-null': OFF, + 'unicorn/no-object-as-default-parameter': WARN, + 'unicorn/no-process-exit': OFF, + 'unicorn/no-unreadable-array-destructuring': OFF, + 'unicorn/no-useless-undefined': OFF, + 'unicorn/prefer-add-event-listener': WARN, + 'unicorn/prefer-array-flat': OFF, + 'unicorn/prefer-module': OFF, + 'unicorn/prefer-negative-index': WARN, + 'unicorn/prefer-node-protocol': OFF, + 'unicorn/prefer-number-properties': OFF, + 'unicorn/prefer-object-from-entries': OFF, + 'unicorn/prefer-optional-catch-binding': WARN, + 'unicorn/prefer-query-selector': WARN, + 'unicorn/prefer-set-has': WARN, + 'unicorn/prefer-spread': OFF, + 'unicorn/prefer-string-slice': WARN, + 'unicorn/prefer-ternary': WARN, + 'unicorn/prevent-abbreviations': OFF, + 'unicorn/template-indent': [WARN, { tags: ['bq', 'gql', 'html', 'pg', 'query', 'sql', 'styled'] }], + }, + overrides: [ + { files: ['./.commitlintrc.js', './.eslintrc.js', './.prettierrc.js'], rules: { 'no-undef': OFF } }, + { files: ['./src/index.ts', './src/configs/*.ts', './src/rules/*.ts'], rules: { 'import/no-default-export': OFF } }, + { files: ['./scripts/*.ts', './tests/**/*.ts'], rules: { 'no-console': OFF } }, + { files: ['./src/index.ts'], rules: { 'max-lines': OFF } }, + ], +}; diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..7880c4d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** +- Version [e.g. 0.0.1] +- Component [e.g. `es-roikoren/no-arrow-functions`] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..6fbf78db --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ + + +## Summary + + + +## Issues + + diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..5b27b3af --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,35 @@ +name: "CodeQL" + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: '16 5 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ['javascript'] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..e708c17f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + if: github.ref == 'refs/heads/main' + uses: actions/checkout@v2 + with: + ref: main + fetch-depth: 0 + persist-credentials: false + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@master + with: + title: 'ci(changesets): version packages' + commit: 'ci(changesets): version packages' + publish: yarn release + env: + GITHUB_TOKEN: ${{ secrets.GHPR_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..c83e085b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12, 14, 16] + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: yarn cache directory + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Setup node_modules cache + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Install + run: yarn install --frozen-lockfile + - name: Deduplicate yarn.lock + run: yarn deduplicate --list --fail + - name: Lint + run: yarn lint + - name: Type + run: yarn type + - name: Test + run: yarn test + - name: Build + run: yarn build diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..15196596 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Node Modules +node_modules/ +**/*.js +!.commitlintrc.js +!.eslintrc.js +!.prettierrc.js +**/*.d.ts +.idea/ +.eslintcache +yarn-error.log + +# Coverage +.nyc_output/ +coverage/ +reports/ diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..d71a03b9 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..e6176d25 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn lint-staged +yarn deduplicate --list --fail diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000..f077c917 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn test diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 00000000..ab1e8c60 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "extension": ["ts"], + "spec": "tests/**/*.ts", + "require": "ts-node/register" +} \ No newline at end of file diff --git a/.nycrc b/.nycrc new file mode 100644 index 00000000..3bf9d5fd --- /dev/null +++ b/.nycrc @@ -0,0 +1,3 @@ +{ + "include": ["src/**/*.ts"] +} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..61fa3cb3 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1 @@ +module.exports = { printWidth: 121, singleQuote: true, trailingComma: 'all', endOfLine: 'auto' }; diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..f5d93ab0 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socioeconomic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +rnd@altnext.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..ac66ac88 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,148 @@ +# Contributing to this project + +_**Please Note:** These guidelines were adapted from [@necolas](https://github.com/necolas)'s +[issue-guidelines](https://github.com/necolas/issue-guidelines) and serve as +an excellent starting point for contributing to any open source project._ + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue or assessing +patches and features. + + +## Using the issue tracker + +The issue tracker is the preferred channel for [bug reports](#bugs), +[features requests](#features) and [submitting pull +requests](#pull-requests), but please respect the following restrictions: + +* Please **do not** use the issue tracker for personal support requests (use + [Stack Overflow](http://stackoverflow.com) or IRC). + +* Please **do not** derail or troll issues. Keep the discussion on topic and + respect the opinions of others. + + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful - thank you! + +Guidelines for bug reports: + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the + latest `main` or development branch in the repository. + +3. **Isolate the problem** — create a [reduced test + case](http://css-tricks.com/reduced-test-cases/) and a live example. + +A good bug report shouldn't leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment? What steps will reproduce the issue? What browser(s) and OS +experience the problem? What would you expect to be the outcome? All these +details will help people to fix any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the browser/OS environment in which it occurs. If +> suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> `` - a link to the reduced test case +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + + + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + + + +## Pull requests + +Good pull requests - patches, improvements, new features - are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any significant pull request (e.g. +implementing features, refactoring code, porting to a different language), +otherwise you risk spending a lot of time working on something that the +project's developers might not want to merge into the project. + +Please adhere to the coding conventions used throughout a project (indentation, +accurate comments, etc.) and any other requirements (such as test coverage). + +Follow this process if you'd like your work considered for inclusion in the +project: + +1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, + and configure the remotes: + + ```bash + # Clone your fork of the repo into the current directory + git clone https://github.com//eslint-plugin-es + # Navigate to the newly cloned directory + cd eslint-plugin-es + # Assign the original repo to a remote called "upstream" + git remote add upstream https://github.com/roikoren755/eslint-plugin-es + ``` + +2. If you cloned a while ago, get the latest changes from upstream: + + ```bash + git checkout main + git pull upstream main + ``` + +3. Create a new topic branch (off the main project development branch) to + contain your feature, change, or fix: + + ```bash + git checkout -b + ``` + +4. Commit your changes in logical chunks. Please adhere to these [git commit + message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) + or your code is unlikely be merged into the main project. Use Git's + [interactive rebase](https://help.github.com/articles/interactive-rebase) + feature to tidy up your commits before making them public. + * Make sure that running `yarn lint` and `yarn type` both do not show any errors. + + +5. Locally merge (or rebase) the upstream development branch into your topic branch: + + ```bash + git pull [--rebase] upstream main + ``` + +6. Push your topic branch up to your fork: + + ```bash + git push origin + ``` + +7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) + with a clear title and description. + +**IMPORTANT**: By submitting a patch, you agree to allow the project owner to +license your work under the same license as that used by the project. \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..31915185 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Roi Koren + +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/README.md b/README.md new file mode 100644 index 00000000..b6f32069 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# eslint-plugin-es-roikoren + +[![Test Status](https://github.com/roikoren755/eslint-plugin-roikoren755/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/roikoren755/eslint-plugin-roikoren755/actions/workflows/test.yml?query=branch%3Amain) + +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=roikoren755_eslint-plugin-roikoren&metric=bugs)](https://sonarcloud.io/dashboard?id=roikoren755_eslint-plugin-roikoren) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=roikoren755_eslint-plugin-roikoren&metric=code_smells)](https://sonarcloud.io/dashboard?id=roikoren755_eslint-plugin-roikoren) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=roikoren755_eslint-plugin-roikoren&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=roikoren755_eslint-plugin-roikoren) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=roikoren755_eslint-plugin-roikoren&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=roikoren755_eslint-plugin-roikoren) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=roikoren755_eslint-plugin-roikoren&metric=security_rating)](https://sonarcloud.io/dashboard?id=roikoren755_eslint-plugin-roikoren) +[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=roikoren755_eslint-plugin-roikoren&metric=sqale_index)](https://sonarcloud.io/dashboard?id=roikoren755_eslint-plugin-roikoren) +[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=roikoren755_eslint-plugin-roikoren&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=roikoren755_eslint-plugin-roikoren) + +[![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/roikoren755/eslint-plugin-roikoren)](https://app.snyk.io/org/roikoren755/project/46fd7677-38c9-4e4a-a374-664f722e4427) + +[![npm](https://img.shields.io/npm/v/eslint-plugin-roikoren)](https://www.npmjs.com/package/eslint-plugin-roikoren) +[![NPM](https://img.shields.io/npm/l/eslint-plugin-roikoren)](https://www.npmjs.com/package/eslint-plugin-roikoren) +[![npm](https://img.shields.io/npm/dm/eslint-plugin-roikoren)](https://www.npmjs.com/package/eslint-plugin-roikoren) +[![npm bundle size](https://img.shields.io/bundlephobia/minzip/eslint-plugin-roikoren)](https://www.npmjs.com/package/eslint-plugin-roikoren) + +[![GitHub issues](https://img.shields.io/github/issues-raw/roikoren755/eslint-plugin-roikoren)](https://www.github.com/roikoren755/eslint-plugin-roikoren) +[![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/roikoren755/eslint-plugin-roikoren)](https://www.github.com/roikoren755/eslint-plugin-roikoren) +[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/roikoren755/eslint-plugin-roikoren)](https://www.github.com/roikoren755/eslint-plugin-roikoren) +[![Lines of code](https://img.shields.io/tokei/lines/github/roikoren755/eslint-plugin-roikoren)](https://www.github.com/roikoren755/eslint-plugin-roikoren) +[![GitHub top language](https://img.shields.io/github/languages/top/roikoren755/eslint-plugin-roikoren)](https://www.github.com/roikoren755/eslint-plugin-roikoren) + +A re-implementation of `eslint-plugin-es`, compatible with `eslint@8`. + +### Installation + +Run `npm i -D eslint-plugin-es-roikoren` (or `yarn add -D eslint-plugin-es-roikoren`) to add this package to your project's `devDependencies`. + +### Usage + +In your `.eslintrc.js` (or any other file you use to configure eslint), +add the config you want from this package to the `extends` field. + +TODO diff --git a/docs/rules/README.md b/docs/rules/README.md new file mode 100644 index 00000000..c7babca6 --- /dev/null +++ b/docs/rules/README.md @@ -0,0 +1,208 @@ +# Available Rules + +This plugin provides the following rules. + +- 🔧 mark means that the `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by the rule. + +## ES2021 + +There is a config that enables the rules in this category: `plugin:es-roikoren/no-new-in-esnext` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-logical-assignment-operators](./no-logical-assignment-operators.md) | disallow logical assignment operators. | 🔧 | +| [es-roikoren/no-numeric-separators](./no-numeric-separators.md) | disallow numeric separators. | 🔧 | +| [es-roikoren/no-promise-any](./no-promise-any.md) | disallow `Promise.any` function and `AggregateError` class. | | +| [es-roikoren/no-string-prototype-replaceall](./no-string-prototype-replaceall.md) | disallow the `String.prototype.replaceAll` method. | | +| [es-roikoren/no-weakrefs](./no-weakrefs.md) | disallow the `WeakRef` and `FinalizationRegistry` class. | | + +## ES2020 + +There are multiple configs that enable all rules in this category: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-bigint](./no-bigint.md) | disallow `bigint` syntax and built-ins. | | +| [es-roikoren/no-dynamic-import](./no-dynamic-import.md) | disallow `import()` syntax. | | +| [es-roikoren/no-export-ns-from](./no-export-ns-from.md) | disallow `export * as ns`. | | +| [es-roikoren/no-global-this](./no-global-this.md) | disallow the `globalThis` variable. | | +| [es-roikoren/no-import-meta](./no-import-meta.md) | disallow `import.meta` meta property. | | +| [es-roikoren/no-nullish-coalescing-operators](./no-nullish-coalescing-operators.md) | disallow nullish coalescing operators. | | +| [es-roikoren/no-optional-chaining](./no-optional-chaining.md) | disallow optional chaining. | | +| [es-roikoren/no-promise-all-settled](./no-promise-all-settled.md) | disallow `Promise.allSettled` function. | | +| [es-roikoren/no-string-prototype-matchall](./no-string-prototype-matchall.md) | disallow the `String.prototype.matchAll` method. | | + +## ES2019 + +There are multiple configs that enable all rules in this category: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-array-prototype-flat](./no-array-prototype-flat.md) | disallow the `Array.prototype.{flat,flatMap}` method. | | +| [es-roikoren/no-json-superset](./no-json-superset.md) | disallow `\u2028` and `\u2029` in string literals. | 🔧 | +| [es-roikoren/no-object-fromentries](./no-object-fromentries.md) | disallow the `Object.fromEntries` method. | | +| [es-roikoren/no-optional-catch-binding](./no-optional-catch-binding.md) | disallow optional `catch` binding. | | +| [es-roikoren/no-regexp-unicode-property-escapes-2019](./no-regexp-unicode-property-escapes-2019.md) | disallow the new values of RegExp Unicode property escape sequences in ES2019. | | +| [es-roikoren/no-string-prototype-trimstart-trimend](./no-string-prototype-trimstart-trimend.md) | disallow the `String.prototype.{trimStart,trimEnd}` methods. | | +| [es-roikoren/no-symbol-prototype-description](./no-symbol-prototype-description.md) | disallow the `Symbol.prototype.description` property. | | + +## ES2018 + +There are multiple configs that enable all rules in this category: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-async-iteration](./no-async-iteration.md) | disallow async iteration. | | +| [es-roikoren/no-malformed-template-literals](./no-malformed-template-literals.md) | disallow template literals with invalid escape sequences. | | +| [es-roikoren/no-promise-prototype-finally](./no-promise-prototype-finally.md) | disallow the `Promise.prototype.finally` method. | | +| [es-roikoren/no-regexp-lookbehind-assertions](./no-regexp-lookbehind-assertions.md) | disallow RegExp lookbehind assertions. | | +| [es-roikoren/no-regexp-named-capture-groups](./no-regexp-named-capture-groups.md) | disallow RegExp named capture groups. | | +| [es-roikoren/no-regexp-s-flag](./no-regexp-s-flag.md) | disallow RegExp `s` flag. | | +| [es-roikoren/no-regexp-unicode-property-escapes](./no-regexp-unicode-property-escapes.md) | disallow RegExp Unicode property escape sequences. | | +| [es-roikoren/no-rest-spread-properties](./no-rest-spread-properties.md) | disallow rest/spread properties. | | + +## ES2017 + +There are multiple configs that enable all rules in this category: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-async-functions](./no-async-functions.md) | disallow async function declarations. | | +| [es-roikoren/no-atomics](./no-atomics.md) | disallow the `Atomics` class. | | +| [es-roikoren/no-object-entries](./no-object-entries.md) | disallow the `Object.entries` method. | | +| [es-roikoren/no-object-getownpropertydescriptors](./no-object-getownpropertydescriptors.md) | disallow the `Object.getOwnPropertyDescriptors` method. | | +| [es-roikoren/no-object-values](./no-object-values.md) | disallow the `Object.values` method. | | +| [es-roikoren/no-shared-array-buffer](./no-shared-array-buffer.md) | disallow the `SharedArrayBuffer` class. | | +| [es-roikoren/no-string-prototype-padstart-padend](./no-string-prototype-padstart-padend.md) | disallow the `String.prototype.{padStart,padEnd}` methods. | | +| [es-roikoren/no-trailing-function-commas](./no-trailing-function-commas.md) | disallow trailing commas in parameter/argument lists. | 🔧 | + +## ES2016 + +There are multiple configs that enable all rules in this category: `plugin:es-roikoren/no-new-in-es2016`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, and `plugin:es-roikoren/restrict-to-es2015` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-array-prototype-includes](./no-array-prototype-includes.md) | disallow the `Array.prototype.includes` method. | | +| [es-roikoren/no-exponential-operators](./no-exponential-operators.md) | disallow exponential operators. | | + +## ES2015 + +There are multiple configs that enable all rules in this category: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-array-from](./no-array-from.md) | disallow the `Array.from` method. | | +| [es-roikoren/no-array-of](./no-array-of.md) | disallow the `Array.of` method. | | +| [es-roikoren/no-array-prototype-copywithin](./no-array-prototype-copywithin.md) | disallow the `Array.prototype.copyWithin` method. | | +| [es-roikoren/no-array-prototype-entries](./no-array-prototype-entries.md) | disallow the `Array.prototype.entries` method. | | +| [es-roikoren/no-array-prototype-fill](./no-array-prototype-fill.md) | disallow the `Array.prototype.fill` method. | | +| [es-roikoren/no-array-prototype-find](./no-array-prototype-find.md) | disallow the `Array.prototype.find` method. | | +| [es-roikoren/no-array-prototype-findindex](./no-array-prototype-findindex.md) | disallow the `Array.prototype.findIndex` method. | | +| [es-roikoren/no-array-prototype-keys](./no-array-prototype-keys.md) | disallow the `Array.prototype.keys` method. | | +| [es-roikoren/no-array-prototype-values](./no-array-prototype-values.md) | disallow the `Array.prototype.values` method. | | +| [es-roikoren/no-arrow-functions](./no-arrow-functions.md) | disallow arrow function expressions. | 🔧 | +| [es-roikoren/no-binary-numeric-literals](./no-binary-numeric-literals.md) | disallow binary numeric literals. | | +| [es-roikoren/no-block-scoped-functions](./no-block-scoped-functions.md) | disallow block-scoped function declarations. | | +| [es-roikoren/no-block-scoped-variables](./no-block-scoped-variables.md) | disallow block-scoped variable declarations. | | +| [es-roikoren/no-classes](./no-classes.md) | disallow class declarations. | | +| [es-roikoren/no-computed-properties](./no-computed-properties.md) | disallow computed properties. | | +| [es-roikoren/no-default-parameters](./no-default-parameters.md) | disallow default parameters. | | +| [es-roikoren/no-destructuring](./no-destructuring.md) | disallow destructuring. | | +| [es-roikoren/no-for-of-loops](./no-for-of-loops.md) | disallow `for-of` statements. | | +| [es-roikoren/no-generators](./no-generators.md) | disallow generator function declarations. | | +| [es-roikoren/no-map](./no-map.md) | disallow the `Map` class. | | +| [es-roikoren/no-math-acosh](./no-math-acosh.md) | disallow the `Math.acosh` method. | | +| [es-roikoren/no-math-asinh](./no-math-asinh.md) | disallow the `Math.asinh` method. | | +| [es-roikoren/no-math-atanh](./no-math-atanh.md) | disallow the `Math.atanh` method. | | +| [es-roikoren/no-math-cbrt](./no-math-cbrt.md) | disallow the `Math.cbrt` method. | | +| [es-roikoren/no-math-clz32](./no-math-clz32.md) | disallow the `Math.clz32` method. | | +| [es-roikoren/no-math-cosh](./no-math-cosh.md) | disallow the `Math.cosh` method. | | +| [es-roikoren/no-math-expm1](./no-math-expm1.md) | disallow the `Math.expm1` method. | | +| [es-roikoren/no-math-fround](./no-math-fround.md) | disallow the `Math.fround` method. | | +| [es-roikoren/no-math-hypot](./no-math-hypot.md) | disallow the `Math.hypot` method. | | +| [es-roikoren/no-math-imul](./no-math-imul.md) | disallow the `Math.imul` method. | | +| [es-roikoren/no-math-log10](./no-math-log10.md) | disallow the `Math.log10` method. | | +| [es-roikoren/no-math-log1p](./no-math-log1p.md) | disallow the `Math.log1p` method. | | +| [es-roikoren/no-math-log2](./no-math-log2.md) | disallow the `Math.log2` method. | | +| [es-roikoren/no-math-sign](./no-math-sign.md) | disallow the `Math.sign` method. | | +| [es-roikoren/no-math-sinh](./no-math-sinh.md) | disallow the `Math.sinh` method. | | +| [es-roikoren/no-math-tanh](./no-math-tanh.md) | disallow the `Math.tanh` method. | | +| [es-roikoren/no-math-trunc](./no-math-trunc.md) | disallow the `Math.trunc` method. | | +| [es-roikoren/no-modules](./no-modules.md) | disallow modules. | | +| [es-roikoren/no-new-target](./no-new-target.md) | disallow `new.target` meta property. | | +| [es-roikoren/no-number-epsilon](./no-number-epsilon.md) | disallow the `Number.EPSILON` property. | | +| [es-roikoren/no-number-isfinite](./no-number-isfinite.md) | disallow the `Number.isFinite` property. | | +| [es-roikoren/no-number-isinteger](./no-number-isinteger.md) | disallow the `Number.isInteger` property. | | +| [es-roikoren/no-number-isnan](./no-number-isnan.md) | disallow the `Number.isNaN` property. | | +| [es-roikoren/no-number-issafeinteger](./no-number-issafeinteger.md) | disallow the `Number.isSafeInteger` property. | | +| [es-roikoren/no-number-maxsafeinteger](./no-number-maxsafeinteger.md) | disallow the `Number.MAX_SAFE_INTEGER` property. | | +| [es-roikoren/no-number-minsafeinteger](./no-number-minsafeinteger.md) | disallow the `Number.MIN_SAFE_INTEGER` property. | | +| [es-roikoren/no-number-parsefloat](./no-number-parsefloat.md) | disallow the `Number.parseFloat` property. | | +| [es-roikoren/no-number-parseint](./no-number-parseint.md) | disallow the `Number.parseInt` property. | | +| [es-roikoren/no-object-assign](./no-object-assign.md) | disallow the `Object.assign` method. | | +| [es-roikoren/no-object-getownpropertysymbols](./no-object-getownpropertysymbols.md) | disallow the `Object.getOwnPropertySymbols` method. | | +| [es-roikoren/no-object-is](./no-object-is.md) | disallow the `Object.is` method. | | +| [es-roikoren/no-object-setprototypeof](./no-object-setprototypeof.md) | disallow the `Object.setPrototypeOf` method. | | +| [es-roikoren/no-object-super-properties](./no-object-super-properties.md) | disallow `super` property accesses in object literals. | | +| [es-roikoren/no-octal-numeric-literals](./no-octal-numeric-literals.md) | disallow octal numeric literals. | | +| [es-roikoren/no-promise](./no-promise.md) | disallow the `Promise` class. | | +| [es-roikoren/no-property-shorthands](./no-property-shorthands.md) | disallow property shorthands. | 🔧 | +| [es-roikoren/no-proxy](./no-proxy.md) | disallow the `Proxy` class. | | +| [es-roikoren/no-reflect](./no-reflect.md) | disallow the `Reflect` class. | | +| [es-roikoren/no-regexp-prototype-flags](./no-regexp-prototype-flags.md) | disallow the `RegExp.prototype.flags` property. | | +| [es-roikoren/no-regexp-u-flag](./no-regexp-u-flag.md) | disallow RegExp `u` flag. | | +| [es-roikoren/no-regexp-y-flag](./no-regexp-y-flag.md) | disallow RegExp `y` flag. | | +| [es-roikoren/no-rest-parameters](./no-rest-parameters.md) | disallow rest parameters. | | +| [es-roikoren/no-set](./no-set.md) | disallow the `Set` class. | | +| [es-roikoren/no-spread-elements](./no-spread-elements.md) | disallow spread elements. | | +| [es-roikoren/no-string-fromcodepoint](./no-string-fromcodepoint.md) | disallow the `String.fromCodePoint` method. | | +| [es-roikoren/no-string-prototype-codepointat](./no-string-prototype-codepointat.md) | disallow the `String.prototype.codePointAt` method. | | +| [es-roikoren/no-string-prototype-endswith](./no-string-prototype-endswith.md) | disallow the `String.prototype.endsWith` method. | | +| [es-roikoren/no-string-prototype-includes](./no-string-prototype-includes.md) | disallow the `String.prototype.includes` method. | | +| [es-roikoren/no-string-prototype-normalize](./no-string-prototype-normalize.md) | disallow the `String.prototype.normalize` method. | | +| [es-roikoren/no-string-prototype-repeat](./no-string-prototype-repeat.md) | disallow the `String.prototype.repeat` method. | | +| [es-roikoren/no-string-prototype-startswith](./no-string-prototype-startswith.md) | disallow the `String.prototype.startsWith` method. | | +| [es-roikoren/no-string-raw](./no-string-raw.md) | disallow the `String.raw` method. | | +| [es-roikoren/no-subclassing-builtins](./no-subclassing-builtins.md) | disallow the subclassing of the built-in classes. | | +| [es-roikoren/no-symbol](./no-symbol.md) | disallow the `Symbol` class. | | +| [es-roikoren/no-template-literals](./no-template-literals.md) | disallow template literals. | 🔧 | +| [es-roikoren/no-typed-arrays](./no-typed-arrays.md) | disallow ES2015 typed arrays. | | +| [es-roikoren/no-unicode-codepoint-escapes](./no-unicode-codepoint-escapes.md) | disallow Unicode code point escape sequences. | 🔧 | +| [es-roikoren/no-weak-map](./no-weak-map.md) | disallow the `WeakMap` class. | | +| [es-roikoren/no-weak-set](./no-weak-set.md) | disallow the `WeakSet` class. | | + +## ES5 + +There are multiple configs that enable all rules in this category: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +| Rule ID | Description | | +|:--------|:------------|:--:| +| [es-roikoren/no-accessor-properties](./no-accessor-properties.md) | disallow accessor properties. | | +| [es-roikoren/no-array-isarray](./no-array-isarray.md) | disallow the `Array.isArray` method. | | +| [es-roikoren/no-array-prototype-every](./no-array-prototype-every.md) | disallow the `Array.prototype.every` method. | | +| [es-roikoren/no-array-prototype-filter](./no-array-prototype-filter.md) | disallow the `Array.prototype.filter` method. | | +| [es-roikoren/no-array-prototype-foreach](./no-array-prototype-foreach.md) | disallow the `Array.prototype.forEach` method. | | +| [es-roikoren/no-array-prototype-indexof](./no-array-prototype-indexof.md) | disallow the `Array.prototype.indexOf` method. | | +| [es-roikoren/no-array-prototype-lastindexof](./no-array-prototype-lastindexof.md) | disallow the `Array.prototype.lastIndexOf` method. | | +| [es-roikoren/no-array-prototype-map](./no-array-prototype-map.md) | disallow the `Array.prototype.map` method. | | +| [es-roikoren/no-array-prototype-reduce](./no-array-prototype-reduce.md) | disallow the `Array.prototype.reduce` method. | | +| [es-roikoren/no-array-prototype-reduceright](./no-array-prototype-reduceright.md) | disallow the `Array.prototype.reduceRight` method. | | +| [es-roikoren/no-array-prototype-some](./no-array-prototype-some.md) | disallow the `Array.prototype.some` method. | | +| [es-roikoren/no-date-now](./no-date-now.md) | disallow the `Date.now` method. | | +| [es-roikoren/no-json](./no-json.md) | disallow the `JSON` class. | | +| [es-roikoren/no-keyword-properties](./no-keyword-properties.md) | disallow reserved words as property names. | | +| [es-roikoren/no-object-defineproperties](./no-object-defineproperties.md) | disallow the `Object.defineProperties` method. | | +| [es-roikoren/no-object-defineproperty](./no-object-defineproperty.md) | disallow the `Object.defineProperty` method. | | +| [es-roikoren/no-object-freeze](./no-object-freeze.md) | disallow the `Object.freeze` method. | | +| [es-roikoren/no-object-getownpropertydescriptor](./no-object-getownpropertydescriptor.md) | disallow the `Object.getOwnPropertyDescriptor` method. | | +| [es-roikoren/no-object-getownpropertynames](./no-object-getownpropertynames.md) | disallow the `Object.getOwnPropertyNames` method. | | +| [es-roikoren/no-object-getprototypeof](./no-object-getprototypeof.md) | disallow the `Object.getPrototypeOf` method. | | +| [es-roikoren/no-object-isextensible](./no-object-isextensible.md) | disallow the `Object.isExtensible` method. | | +| [es-roikoren/no-object-isfrozen](./no-object-isfrozen.md) | disallow the `Object.isFrozen` method. | | +| [es-roikoren/no-object-issealed](./no-object-issealed.md) | disallow the `Object.isSealed` method. | | +| [es-roikoren/no-object-keys](./no-object-keys.md) | disallow the `Object.keys` method. | | +| [es-roikoren/no-object-preventextensions](./no-object-preventextensions.md) | disallow the `Object.preventExtensions` method. | | +| [es-roikoren/no-object-seal](./no-object-seal.md) | disallow the `Object.seal` method. | | +| [es-roikoren/no-string-prototype-trim](./no-string-prototype-trim.md) | disallow the `String.prototype.trim` method. | | +| [es-roikoren/no-trailing-commas](./no-trailing-commas.md) | disallow trailing commas in array/object literals. | | + diff --git a/docs/rules/no-accessor-properties.md b/docs/rules/no-accessor-properties.md new file mode 100644 index 00000000..06030379 --- /dev/null +++ b/docs/rules/no-accessor-properties.md @@ -0,0 +1,26 @@ +# es-roikoren/no-accessor-properties +> disallow accessor properties. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 accessor properties as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-accessor-properties.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-accessor-properties.ts) diff --git a/docs/rules/no-array-from.md b/docs/rules/no-array-from.md new file mode 100644 index 00000000..5581bcc4 --- /dev/null +++ b/docs/rules/no-array-from.md @@ -0,0 +1,19 @@ +# es-roikoren/no-array-from +> disallow the `Array.from` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.from` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-from.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-from.ts) diff --git a/docs/rules/no-array-isarray.md b/docs/rules/no-array-isarray.md new file mode 100644 index 00000000..2103f6f5 --- /dev/null +++ b/docs/rules/no-array-isarray.md @@ -0,0 +1,19 @@ +# es-roikoren/no-array-isarray +> disallow the `Array.isArray` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.isArray` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-isarray.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-isarray.ts) diff --git a/docs/rules/no-array-of.md b/docs/rules/no-array-of.md new file mode 100644 index 00000000..8c1f754c --- /dev/null +++ b/docs/rules/no-array-of.md @@ -0,0 +1,19 @@ +# es-roikoren/no-array-of +> disallow the `Array.of` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.of` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-of.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-of.ts) diff --git a/docs/rules/no-array-prototype-copywithin.md b/docs/rules/no-array-prototype-copywithin.md new file mode 100644 index 00000000..92d777e2 --- /dev/null +++ b/docs/rules/no-array-prototype-copywithin.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-copywithin +> disallow the `Array.prototype.copyWithin` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.prototype.copyWithin` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-copywithin: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-copywithin.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-copywithin.ts) diff --git a/docs/rules/no-array-prototype-entries.md b/docs/rules/no-array-prototype-entries.md new file mode 100644 index 00000000..9043bb13 --- /dev/null +++ b/docs/rules/no-array-prototype-entries.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-entries +> disallow the `Array.prototype.entries` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.prototype.entries` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-entries: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-entries.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-entries.ts) diff --git a/docs/rules/no-array-prototype-every.md b/docs/rules/no-array-prototype-every.md new file mode 100644 index 00000000..e05e7ae0 --- /dev/null +++ b/docs/rules/no-array-prototype-every.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-every +> disallow the `Array.prototype.every` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.every` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-every: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-every.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-every.ts) diff --git a/docs/rules/no-array-prototype-fill.md b/docs/rules/no-array-prototype-fill.md new file mode 100644 index 00000000..58fcef9c --- /dev/null +++ b/docs/rules/no-array-prototype-fill.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-fill +> disallow the `Array.prototype.fill` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.prototype.fill` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-fill: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-fill.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-fill.ts) diff --git a/docs/rules/no-array-prototype-filter.md b/docs/rules/no-array-prototype-filter.md new file mode 100644 index 00000000..0c671d54 --- /dev/null +++ b/docs/rules/no-array-prototype-filter.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-filter +> disallow the `Array.prototype.filter` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.filter` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-filter: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-filter.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-filter.ts) diff --git a/docs/rules/no-array-prototype-find.md b/docs/rules/no-array-prototype-find.md new file mode 100644 index 00000000..14e56296 --- /dev/null +++ b/docs/rules/no-array-prototype-find.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-find +> disallow the `Array.prototype.find` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.prototype.find` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-find: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-find.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-find.ts) diff --git a/docs/rules/no-array-prototype-findindex.md b/docs/rules/no-array-prototype-findindex.md new file mode 100644 index 00000000..1b84dc26 --- /dev/null +++ b/docs/rules/no-array-prototype-findindex.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-findindex +> disallow the `Array.prototype.findIndex` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.prototype.findIndex` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-findindex: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-findindex.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-findindex.ts) diff --git a/docs/rules/no-array-prototype-flat.md b/docs/rules/no-array-prototype-flat.md new file mode 100644 index 00000000..eddea0f0 --- /dev/null +++ b/docs/rules/no-array-prototype-flat.md @@ -0,0 +1,36 @@ +# es-roikoren/no-array-prototype-flat +> disallow the `Array.prototype.{flat,flatMap}` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` + +This rule reports ES2019 [`Array.prototype.{flat,flatMap}` methods](https://github.com/tc39/proposal-flatMap) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-flat: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-flat.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-flat.ts) diff --git a/docs/rules/no-array-prototype-foreach.md b/docs/rules/no-array-prototype-foreach.md new file mode 100644 index 00000000..7fce2b96 --- /dev/null +++ b/docs/rules/no-array-prototype-foreach.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-foreach +> disallow the `Array.prototype.forEach` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.forEach` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-foreach: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-foreach.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-foreach.ts) diff --git a/docs/rules/no-array-prototype-includes.md b/docs/rules/no-array-prototype-includes.md new file mode 100644 index 00000000..45ce6446 --- /dev/null +++ b/docs/rules/no-array-prototype-includes.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-includes +> disallow the `Array.prototype.includes` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2016`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, and `plugin:es-roikoren/restrict-to-es2015` + +This rule reports ES2016 [`Array.prototype.includes` method](https://github.com/tc39/proposal-Array.prototype.includes) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-includes: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-includes.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-includes.ts) diff --git a/docs/rules/no-array-prototype-indexof.md b/docs/rules/no-array-prototype-indexof.md new file mode 100644 index 00000000..637f9b89 --- /dev/null +++ b/docs/rules/no-array-prototype-indexof.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-indexof +> disallow the `Array.prototype.indexOf` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.indexOf` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-indexof: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-indexof.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-indexof.ts) diff --git a/docs/rules/no-array-prototype-keys.md b/docs/rules/no-array-prototype-keys.md new file mode 100644 index 00000000..fdc0dd8b --- /dev/null +++ b/docs/rules/no-array-prototype-keys.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-keys +> disallow the `Array.prototype.keys` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.prototype.keys` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-keys: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-keys.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-keys.ts) diff --git a/docs/rules/no-array-prototype-lastindexof.md b/docs/rules/no-array-prototype-lastindexof.md new file mode 100644 index 00000000..357223e6 --- /dev/null +++ b/docs/rules/no-array-prototype-lastindexof.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-lastindexof +> disallow the `Array.prototype.lastIndexOf` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.lastIndexOf` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-lastindexof: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-lastindexof.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-lastindexof.ts) diff --git a/docs/rules/no-array-prototype-map.md b/docs/rules/no-array-prototype-map.md new file mode 100644 index 00000000..1ec184f9 --- /dev/null +++ b/docs/rules/no-array-prototype-map.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-map +> disallow the `Array.prototype.map` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.map` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-map: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-map.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-map.ts) diff --git a/docs/rules/no-array-prototype-reduce.md b/docs/rules/no-array-prototype-reduce.md new file mode 100644 index 00000000..4369bedd --- /dev/null +++ b/docs/rules/no-array-prototype-reduce.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-reduce +> disallow the `Array.prototype.reduce` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.reduce` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-reduce: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-reduce.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-reduce.ts) diff --git a/docs/rules/no-array-prototype-reduceright.md b/docs/rules/no-array-prototype-reduceright.md new file mode 100644 index 00000000..eaf5d358 --- /dev/null +++ b/docs/rules/no-array-prototype-reduceright.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-reduceright +> disallow the `Array.prototype.reduceRight` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.reduceRight` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-reduceright: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-reduceright.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-reduceright.ts) diff --git a/docs/rules/no-array-prototype-some.md b/docs/rules/no-array-prototype-some.md new file mode 100644 index 00000000..f1daa8e4 --- /dev/null +++ b/docs/rules/no-array-prototype-some.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-some +> disallow the `Array.prototype.some` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Array.prototype.some` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-some: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-some.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-some.ts) diff --git a/docs/rules/no-array-prototype-values.md b/docs/rules/no-array-prototype-values.md new file mode 100644 index 00000000..9b3f801b --- /dev/null +++ b/docs/rules/no-array-prototype-values.md @@ -0,0 +1,35 @@ +# es-roikoren/no-array-prototype-values +> disallow the `Array.prototype.values` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Array.prototype.values` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-array-prototype-values: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-array-prototype-values.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-array-prototype-values.ts) diff --git a/docs/rules/no-arrow-functions.md b/docs/rules/no-arrow-functions.md new file mode 100644 index 00000000..4ef529da --- /dev/null +++ b/docs/rules/no-arrow-functions.md @@ -0,0 +1,28 @@ +# es-roikoren/no-arrow-functions +> disallow arrow function expressions. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2015 arrow functions as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +👌 Examples of **correct** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-arrow-functions.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-arrow-functions.ts) diff --git a/docs/rules/no-async-functions.md b/docs/rules/no-async-functions.md new file mode 100644 index 00000000..6b17fa31 --- /dev/null +++ b/docs/rules/no-async-functions.md @@ -0,0 +1,23 @@ +# es-roikoren/no-async-functions +> disallow async function declarations. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +This rule reports ES2017 [async functions](https://github.com/tc39/ecmascript-asyncawait) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-async-functions.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-async-functions.ts) diff --git a/docs/rules/no-async-iteration.md b/docs/rules/no-async-iteration.md new file mode 100644 index 00000000..1d586d8b --- /dev/null +++ b/docs/rules/no-async-iteration.md @@ -0,0 +1,26 @@ +# es-roikoren/no-async-iteration +> disallow async iteration. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [async iteration](https://github.com/tc39/proposal-async-iteration#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-async-iteration.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-async-iteration.ts) diff --git a/docs/rules/no-atomics.md b/docs/rules/no-atomics.md new file mode 100644 index 00000000..52b1f7e7 --- /dev/null +++ b/docs/rules/no-atomics.md @@ -0,0 +1,19 @@ +# es-roikoren/no-atomics +> disallow the `Atomics` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +This rule reports ES2017 `Atomics` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-atomics.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-atomics.ts) diff --git a/docs/rules/no-bigint.md b/docs/rules/no-bigint.md new file mode 100644 index 00000000..a97ecdf3 --- /dev/null +++ b/docs/rules/no-bigint.md @@ -0,0 +1,22 @@ +# es-roikoren/no-bigint +> disallow `bigint` syntax and built-ins. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [BigInt](https://github.com/tc39/proposal-bigint) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-bigint.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-bigint.ts) diff --git a/docs/rules/no-binary-numeric-literals.md b/docs/rules/no-binary-numeric-literals.md new file mode 100644 index 00000000..df40d8f2 --- /dev/null +++ b/docs/rules/no-binary-numeric-literals.md @@ -0,0 +1,19 @@ +# es-roikoren/no-binary-numeric-literals +> disallow binary numeric literals. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 binary numeric literals as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-binary-numeric-literals.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-binary-numeric-literals.ts) diff --git a/docs/rules/no-block-scoped-functions.md b/docs/rules/no-block-scoped-functions.md new file mode 100644 index 00000000..a32874b2 --- /dev/null +++ b/docs/rules/no-block-scoped-functions.md @@ -0,0 +1,23 @@ +# es-roikoren/no-block-scoped-functions +> disallow block-scoped function declarations. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 block-scoped function declarations as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-block-scoped-functions.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-block-scoped-functions.ts) diff --git a/docs/rules/no-block-scoped-variables.md b/docs/rules/no-block-scoped-variables.md new file mode 100644 index 00000000..4943485c --- /dev/null +++ b/docs/rules/no-block-scoped-variables.md @@ -0,0 +1,20 @@ +# es-roikoren/no-block-scoped-variables +> disallow block-scoped variable declarations. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 block-scoped variable declarations as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-block-scoped-variables.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-block-scoped-variables.ts) diff --git a/docs/rules/no-classes.md b/docs/rules/no-classes.md new file mode 100644 index 00000000..969024b0 --- /dev/null +++ b/docs/rules/no-classes.md @@ -0,0 +1,20 @@ +# es-roikoren/no-classes +> disallow class declarations. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 class declarations as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-classes.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-classes.ts) diff --git a/docs/rules/no-computed-properties.md b/docs/rules/no-computed-properties.md new file mode 100644 index 00000000..cc8e3ab5 --- /dev/null +++ b/docs/rules/no-computed-properties.md @@ -0,0 +1,27 @@ +# es-roikoren/no-computed-properties +> disallow computed properties. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 computed properties as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-computed-properties.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-computed-properties.ts) diff --git a/docs/rules/no-date-now.md b/docs/rules/no-date-now.md new file mode 100644 index 00000000..7ec4bff1 --- /dev/null +++ b/docs/rules/no-date-now.md @@ -0,0 +1,19 @@ +# es-roikoren/no-date-now +> disallow the `Date.now` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Date.now` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-date-now.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-date-now.ts) diff --git a/docs/rules/no-default-parameters.md b/docs/rules/no-default-parameters.md new file mode 100644 index 00000000..c0b479f4 --- /dev/null +++ b/docs/rules/no-default-parameters.md @@ -0,0 +1,19 @@ +# es-roikoren/no-default-parameters +> disallow default parameters. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 default parameters as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-default-parameters.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-default-parameters.ts) diff --git a/docs/rules/no-destructuring.md b/docs/rules/no-destructuring.md new file mode 100644 index 00000000..1d02d3d9 --- /dev/null +++ b/docs/rules/no-destructuring.md @@ -0,0 +1,24 @@ +# es-roikoren/no-destructuring +> disallow destructuring. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 destructuring assignments/bindings as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-destructuring.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-destructuring.ts) diff --git a/docs/rules/no-dynamic-import.md b/docs/rules/no-dynamic-import.md new file mode 100644 index 00000000..fa81a957 --- /dev/null +++ b/docs/rules/no-dynamic-import.md @@ -0,0 +1,21 @@ +# es-roikoren/no-dynamic-import +> disallow `import()` syntax. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [`import()` syntax](https://github.com/tc39/proposal-dynamic-import) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-dynamic-import.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-dynamic-import.ts) diff --git a/docs/rules/no-exponential-operators.md b/docs/rules/no-exponential-operators.md new file mode 100644 index 00000000..d830bd92 --- /dev/null +++ b/docs/rules/no-exponential-operators.md @@ -0,0 +1,20 @@ +# es-roikoren/no-exponential-operators +> disallow exponential operators. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2016`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, and `plugin:es-roikoren/restrict-to-es2015` + +This rule reports ES2016 [exponential operators](https://github.com/rwaldron/exponentiation-operator#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-exponential-operators.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-exponential-operators.ts) diff --git a/docs/rules/no-export-ns-from.md b/docs/rules/no-export-ns-from.md new file mode 100644 index 00000000..057b5d8c --- /dev/null +++ b/docs/rules/no-export-ns-from.md @@ -0,0 +1,19 @@ +# es-roikoren/no-export-ns-from +> disallow `export * as ns`. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [`export * as ns`](https://github.com/tc39/proposal-export-ns-from) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-export-ns-from.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-export-ns-from.ts) diff --git a/docs/rules/no-for-of-loops.md b/docs/rules/no-for-of-loops.md new file mode 100644 index 00000000..4b16dd34 --- /dev/null +++ b/docs/rules/no-for-of-loops.md @@ -0,0 +1,21 @@ +# es-roikoren/no-for-of-loops +> disallow `for-of` statements. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `for-of` statements as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-for-of-loops.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-for-of-loops.ts) diff --git a/docs/rules/no-generators.md b/docs/rules/no-generators.md new file mode 100644 index 00000000..25bcb5c0 --- /dev/null +++ b/docs/rules/no-generators.md @@ -0,0 +1,26 @@ +# es-roikoren/no-generators +> disallow generator function declarations. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 generator function declarations as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-generators.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-generators.ts) diff --git a/docs/rules/no-global-this.md b/docs/rules/no-global-this.md new file mode 100644 index 00000000..951dccc0 --- /dev/null +++ b/docs/rules/no-global-this.md @@ -0,0 +1,19 @@ +# es-roikoren/no-global-this +> disallow the `globalThis` variable. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 `globalThis` variable as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-global-this.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-global-this.ts) diff --git a/docs/rules/no-import-meta.md b/docs/rules/no-import-meta.md new file mode 100644 index 00000000..aa230926 --- /dev/null +++ b/docs/rules/no-import-meta.md @@ -0,0 +1,19 @@ +# es-roikoren/no-import-meta +> disallow `import.meta` meta property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [import.meta](https://github.com/tc39/proposal-import-meta) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-import-meta.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-import-meta.ts) diff --git a/docs/rules/no-json-superset.md b/docs/rules/no-json-superset.md new file mode 100644 index 00000000..b278941f --- /dev/null +++ b/docs/rules/no-json-superset.md @@ -0,0 +1,21 @@ +# es-roikoren/no-json-superset +> disallow `\u2028` and `\u2029` in string literals. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2019 `\u2028` and `\u2029` in string literals as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-json-superset.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-json-superset.ts) diff --git a/docs/rules/no-json.md b/docs/rules/no-json.md new file mode 100644 index 00000000..03021769 --- /dev/null +++ b/docs/rules/no-json.md @@ -0,0 +1,20 @@ +# es-roikoren/no-json +> disallow the `JSON` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `JSON` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-json.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-json.ts) diff --git a/docs/rules/no-keyword-properties.md b/docs/rules/no-keyword-properties.md new file mode 100644 index 00000000..94a1ae3f --- /dev/null +++ b/docs/rules/no-keyword-properties.md @@ -0,0 +1,21 @@ +# es-roikoren/no-keyword-properties +> disallow reserved words as property names. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 reserved words as property names as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-keyword-properties.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-keyword-properties.ts) diff --git a/docs/rules/no-logical-assignment-operators.md b/docs/rules/no-logical-assignment-operators.md new file mode 100644 index 00000000..5abd77e1 --- /dev/null +++ b/docs/rules/no-logical-assignment-operators.md @@ -0,0 +1,22 @@ +# es-roikoren/no-logical-assignment-operators +> disallow logical assignment operators. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-esnext` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2021 [logical assignment operators](https://github.com/tc39/proposal-logical-assignment) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-logical-assignment-operators.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-logical-assignment-operators.ts) diff --git a/docs/rules/no-malformed-template-literals.md b/docs/rules/no-malformed-template-literals.md new file mode 100644 index 00000000..3a2fc4d0 --- /dev/null +++ b/docs/rules/no-malformed-template-literals.md @@ -0,0 +1,19 @@ +# es-roikoren/no-malformed-template-literals +> disallow template literals with invalid escape sequences. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [template literals with invalid escape sequences](https://github.com/tc39/proposal-template-literal-revision#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-malformed-template-literals.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-malformed-template-literals.ts) diff --git a/docs/rules/no-map.md b/docs/rules/no-map.md new file mode 100644 index 00000000..d9afba59 --- /dev/null +++ b/docs/rules/no-map.md @@ -0,0 +1,19 @@ +# es-roikoren/no-map +> disallow the `Map` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Map` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-map.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-map.ts) diff --git a/docs/rules/no-math-acosh.md b/docs/rules/no-math-acosh.md new file mode 100644 index 00000000..2ac79315 --- /dev/null +++ b/docs/rules/no-math-acosh.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-acosh +> disallow the `Math.acosh` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.acosh` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-acosh.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-acosh.ts) diff --git a/docs/rules/no-math-asinh.md b/docs/rules/no-math-asinh.md new file mode 100644 index 00000000..8b8cced7 --- /dev/null +++ b/docs/rules/no-math-asinh.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-asinh +> disallow the `Math.asinh` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.asinh` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-asinh.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-asinh.ts) diff --git a/docs/rules/no-math-atanh.md b/docs/rules/no-math-atanh.md new file mode 100644 index 00000000..7ee072e5 --- /dev/null +++ b/docs/rules/no-math-atanh.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-atanh +> disallow the `Math.atanh` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.atanh` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-atanh.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-atanh.ts) diff --git a/docs/rules/no-math-cbrt.md b/docs/rules/no-math-cbrt.md new file mode 100644 index 00000000..ad10d626 --- /dev/null +++ b/docs/rules/no-math-cbrt.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-cbrt +> disallow the `Math.cbrt` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.cbrt` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-cbrt.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-cbrt.ts) diff --git a/docs/rules/no-math-clz32.md b/docs/rules/no-math-clz32.md new file mode 100644 index 00000000..1cf4f3a9 --- /dev/null +++ b/docs/rules/no-math-clz32.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-clz32 +> disallow the `Math.clz32` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.clz32` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-clz32.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-clz32.ts) diff --git a/docs/rules/no-math-cosh.md b/docs/rules/no-math-cosh.md new file mode 100644 index 00000000..fa64c6db --- /dev/null +++ b/docs/rules/no-math-cosh.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-cosh +> disallow the `Math.cosh` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.cosh` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-cosh.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-cosh.ts) diff --git a/docs/rules/no-math-expm1.md b/docs/rules/no-math-expm1.md new file mode 100644 index 00000000..3c72b906 --- /dev/null +++ b/docs/rules/no-math-expm1.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-expm1 +> disallow the `Math.expm1` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.expm1` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-expm1.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-expm1.ts) diff --git a/docs/rules/no-math-fround.md b/docs/rules/no-math-fround.md new file mode 100644 index 00000000..44c985d7 --- /dev/null +++ b/docs/rules/no-math-fround.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-fround +> disallow the `Math.fround` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.fround` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-fround.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-fround.ts) diff --git a/docs/rules/no-math-hypot.md b/docs/rules/no-math-hypot.md new file mode 100644 index 00000000..3a03038b --- /dev/null +++ b/docs/rules/no-math-hypot.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-hypot +> disallow the `Math.hypot` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.hypot` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-hypot.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-hypot.ts) diff --git a/docs/rules/no-math-imul.md b/docs/rules/no-math-imul.md new file mode 100644 index 00000000..56c630a7 --- /dev/null +++ b/docs/rules/no-math-imul.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-imul +> disallow the `Math.imul` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.imul` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-imul.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-imul.ts) diff --git a/docs/rules/no-math-log10.md b/docs/rules/no-math-log10.md new file mode 100644 index 00000000..1ae9397d --- /dev/null +++ b/docs/rules/no-math-log10.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-log10 +> disallow the `Math.log10` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.log10` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-log10.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-log10.ts) diff --git a/docs/rules/no-math-log1p.md b/docs/rules/no-math-log1p.md new file mode 100644 index 00000000..2af4bdfb --- /dev/null +++ b/docs/rules/no-math-log1p.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-log1p +> disallow the `Math.log1p` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.log1p` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-log1p.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-log1p.ts) diff --git a/docs/rules/no-math-log2.md b/docs/rules/no-math-log2.md new file mode 100644 index 00000000..a70fac7a --- /dev/null +++ b/docs/rules/no-math-log2.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-log2 +> disallow the `Math.log2` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.log2` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-log2.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-log2.ts) diff --git a/docs/rules/no-math-sign.md b/docs/rules/no-math-sign.md new file mode 100644 index 00000000..3b2bd9ae --- /dev/null +++ b/docs/rules/no-math-sign.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-sign +> disallow the `Math.sign` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.sign` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-sign.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-sign.ts) diff --git a/docs/rules/no-math-sinh.md b/docs/rules/no-math-sinh.md new file mode 100644 index 00000000..336062a5 --- /dev/null +++ b/docs/rules/no-math-sinh.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-sinh +> disallow the `Math.sinh` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.sinh` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-sinh.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-sinh.ts) diff --git a/docs/rules/no-math-tanh.md b/docs/rules/no-math-tanh.md new file mode 100644 index 00000000..084674dd --- /dev/null +++ b/docs/rules/no-math-tanh.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-tanh +> disallow the `Math.tanh` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.tanh` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-tanh.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-tanh.ts) diff --git a/docs/rules/no-math-trunc.md b/docs/rules/no-math-trunc.md new file mode 100644 index 00000000..fda80595 --- /dev/null +++ b/docs/rules/no-math-trunc.md @@ -0,0 +1,19 @@ +# es-roikoren/no-math-trunc +> disallow the `Math.trunc` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Math.trunc` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-math-trunc.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-math-trunc.ts) diff --git a/docs/rules/no-modules.md b/docs/rules/no-modules.md new file mode 100644 index 00000000..69099133 --- /dev/null +++ b/docs/rules/no-modules.md @@ -0,0 +1,24 @@ +# es-roikoren/no-modules +> disallow modules. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 modules as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-modules.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-modules.ts) diff --git a/docs/rules/no-new-target.md b/docs/rules/no-new-target.md new file mode 100644 index 00000000..3de5d9db --- /dev/null +++ b/docs/rules/no-new-target.md @@ -0,0 +1,23 @@ +# es-roikoren/no-new-target +> disallow `new.target` meta property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `new.target` meta property as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-new-target.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-new-target.ts) diff --git a/docs/rules/no-nullish-coalescing-operators.md b/docs/rules/no-nullish-coalescing-operators.md new file mode 100644 index 00000000..3a1f6648 --- /dev/null +++ b/docs/rules/no-nullish-coalescing-operators.md @@ -0,0 +1,26 @@ +# es-roikoren/no-nullish-coalescing-operators +> disallow nullish coalescing operators. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [Nullish Coalescing operators](https://github.com/tc39/proposal-nullish-coalescing) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +👌 Examples of **correct** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-nullish-coalescing-operators.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-nullish-coalescing-operators.ts) diff --git a/docs/rules/no-number-epsilon.md b/docs/rules/no-number-epsilon.md new file mode 100644 index 00000000..d54e486e --- /dev/null +++ b/docs/rules/no-number-epsilon.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-epsilon +> disallow the `Number.EPSILON` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.EPSILON` property as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-epsilon.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-epsilon.ts) diff --git a/docs/rules/no-number-isfinite.md b/docs/rules/no-number-isfinite.md new file mode 100644 index 00000000..69dfdf84 --- /dev/null +++ b/docs/rules/no-number-isfinite.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-isfinite +> disallow the `Number.isFinite` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.isFinite` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-isfinite.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-isfinite.ts) diff --git a/docs/rules/no-number-isinteger.md b/docs/rules/no-number-isinteger.md new file mode 100644 index 00000000..b0580f0d --- /dev/null +++ b/docs/rules/no-number-isinteger.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-isinteger +> disallow the `Number.isInteger` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.isInteger` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-isinteger.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-isinteger.ts) diff --git a/docs/rules/no-number-isnan.md b/docs/rules/no-number-isnan.md new file mode 100644 index 00000000..c2dfff4b --- /dev/null +++ b/docs/rules/no-number-isnan.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-isnan +> disallow the `Number.isNaN` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.isNaN` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-isnan.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-isnan.ts) diff --git a/docs/rules/no-number-issafeinteger.md b/docs/rules/no-number-issafeinteger.md new file mode 100644 index 00000000..1d4a2391 --- /dev/null +++ b/docs/rules/no-number-issafeinteger.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-issafeinteger +> disallow the `Number.isSafeInteger` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.isSafeInteger` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-issafeinteger.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-issafeinteger.ts) diff --git a/docs/rules/no-number-maxsafeinteger.md b/docs/rules/no-number-maxsafeinteger.md new file mode 100644 index 00000000..1448294a --- /dev/null +++ b/docs/rules/no-number-maxsafeinteger.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-maxsafeinteger +> disallow the `Number.MAX_SAFE_INTEGER` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.MAX_SAFE_INTEGER` property as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-maxsafeinteger.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-maxsafeinteger.ts) diff --git a/docs/rules/no-number-minsafeinteger.md b/docs/rules/no-number-minsafeinteger.md new file mode 100644 index 00000000..2aae0841 --- /dev/null +++ b/docs/rules/no-number-minsafeinteger.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-minsafeinteger +> disallow the `Number.MIN_SAFE_INTEGER` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.MIN_SAFE_INTEGER` property as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-minsafeinteger.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-minsafeinteger.ts) diff --git a/docs/rules/no-number-parsefloat.md b/docs/rules/no-number-parsefloat.md new file mode 100644 index 00000000..c527a2db --- /dev/null +++ b/docs/rules/no-number-parsefloat.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-parsefloat +> disallow the `Number.parseFloat` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.parseFloat` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-parsefloat.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-parsefloat.ts) diff --git a/docs/rules/no-number-parseint.md b/docs/rules/no-number-parseint.md new file mode 100644 index 00000000..2d086438 --- /dev/null +++ b/docs/rules/no-number-parseint.md @@ -0,0 +1,19 @@ +# es-roikoren/no-number-parseint +> disallow the `Number.parseInt` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Number.parseInt` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-number-parseint.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-number-parseint.ts) diff --git a/docs/rules/no-numeric-separators.md b/docs/rules/no-numeric-separators.md new file mode 100644 index 00000000..85fda7ad --- /dev/null +++ b/docs/rules/no-numeric-separators.md @@ -0,0 +1,20 @@ +# es-roikoren/no-numeric-separators +> disallow numeric separators. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-esnext` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2021 [numeric separators](https://github.com/tc39/proposal-numeric-separator) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-numeric-separators.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-numeric-separators.ts) diff --git a/docs/rules/no-object-assign.md b/docs/rules/no-object-assign.md new file mode 100644 index 00000000..33b0ac27 --- /dev/null +++ b/docs/rules/no-object-assign.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-assign +> disallow the `Object.assign` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Object.assign` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-assign.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-assign.ts) diff --git a/docs/rules/no-object-defineproperties.md b/docs/rules/no-object-defineproperties.md new file mode 100644 index 00000000..ecd1e7cd --- /dev/null +++ b/docs/rules/no-object-defineproperties.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-defineproperties +> disallow the `Object.defineProperties` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.defineProperties` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-defineproperties.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-defineproperties.ts) diff --git a/docs/rules/no-object-defineproperty.md b/docs/rules/no-object-defineproperty.md new file mode 100644 index 00000000..af348ed8 --- /dev/null +++ b/docs/rules/no-object-defineproperty.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-defineproperty +> disallow the `Object.defineProperty` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.defineProperty` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-defineproperty.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-defineproperty.ts) diff --git a/docs/rules/no-object-entries.md b/docs/rules/no-object-entries.md new file mode 100644 index 00000000..ac0c19ff --- /dev/null +++ b/docs/rules/no-object-entries.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-entries +> disallow the `Object.entries` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +This rule reports ES2017 `Object.entries` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-entries.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-entries.ts) diff --git a/docs/rules/no-object-freeze.md b/docs/rules/no-object-freeze.md new file mode 100644 index 00000000..3a712e1e --- /dev/null +++ b/docs/rules/no-object-freeze.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-freeze +> disallow the `Object.freeze` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.freeze` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-freeze.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-freeze.ts) diff --git a/docs/rules/no-object-fromentries.md b/docs/rules/no-object-fromentries.md new file mode 100644 index 00000000..bf960e32 --- /dev/null +++ b/docs/rules/no-object-fromentries.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-fromentries +> disallow the `Object.fromEntries` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` + +This rule reports ES2019 `Object.fromEntries` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-fromentries.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-fromentries.ts) diff --git a/docs/rules/no-object-getownpropertydescriptor.md b/docs/rules/no-object-getownpropertydescriptor.md new file mode 100644 index 00000000..f72ce374 --- /dev/null +++ b/docs/rules/no-object-getownpropertydescriptor.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-getownpropertydescriptor +> disallow the `Object.getOwnPropertyDescriptor` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.getOwnPropertyDescriptor` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-getownpropertydescriptor.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-getownpropertydescriptor.ts) diff --git a/docs/rules/no-object-getownpropertydescriptors.md b/docs/rules/no-object-getownpropertydescriptors.md new file mode 100644 index 00000000..a2870fd3 --- /dev/null +++ b/docs/rules/no-object-getownpropertydescriptors.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-getownpropertydescriptors +> disallow the `Object.getOwnPropertyDescriptors` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +This rule reports ES2017 `Object.getOwnPropertyDescriptors` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-getownpropertydescriptors.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-getownpropertydescriptors.ts) diff --git a/docs/rules/no-object-getownpropertynames.md b/docs/rules/no-object-getownpropertynames.md new file mode 100644 index 00000000..83d688de --- /dev/null +++ b/docs/rules/no-object-getownpropertynames.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-getownpropertynames +> disallow the `Object.getOwnPropertyNames` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.getOwnPropertyNames` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-getownpropertynames.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-getownpropertynames.ts) diff --git a/docs/rules/no-object-getownpropertysymbols.md b/docs/rules/no-object-getownpropertysymbols.md new file mode 100644 index 00000000..ab663622 --- /dev/null +++ b/docs/rules/no-object-getownpropertysymbols.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-getownpropertysymbols +> disallow the `Object.getOwnPropertySymbols` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Object.getOwnPropertySymbols` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-getownpropertysymbols.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-getownpropertysymbols.ts) diff --git a/docs/rules/no-object-getprototypeof.md b/docs/rules/no-object-getprototypeof.md new file mode 100644 index 00000000..f567359b --- /dev/null +++ b/docs/rules/no-object-getprototypeof.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-getprototypeof +> disallow the `Object.getPrototypeOf` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.getPrototypeOf` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-getprototypeof.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-getprototypeof.ts) diff --git a/docs/rules/no-object-is.md b/docs/rules/no-object-is.md new file mode 100644 index 00000000..07eb6ad2 --- /dev/null +++ b/docs/rules/no-object-is.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-is +> disallow the `Object.is` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Object.is` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-is.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-is.ts) diff --git a/docs/rules/no-object-isextensible.md b/docs/rules/no-object-isextensible.md new file mode 100644 index 00000000..d21918d8 --- /dev/null +++ b/docs/rules/no-object-isextensible.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-isextensible +> disallow the `Object.isExtensible` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.isExtensible` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-isextensible.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-isextensible.ts) diff --git a/docs/rules/no-object-isfrozen.md b/docs/rules/no-object-isfrozen.md new file mode 100644 index 00000000..6405f09a --- /dev/null +++ b/docs/rules/no-object-isfrozen.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-isfrozen +> disallow the `Object.isFrozen` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.isFrozen` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-isfrozen.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-isfrozen.ts) diff --git a/docs/rules/no-object-issealed.md b/docs/rules/no-object-issealed.md new file mode 100644 index 00000000..61368ba1 --- /dev/null +++ b/docs/rules/no-object-issealed.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-issealed +> disallow the `Object.isSealed` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.isSealed` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-issealed.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-issealed.ts) diff --git a/docs/rules/no-object-keys.md b/docs/rules/no-object-keys.md new file mode 100644 index 00000000..9c080614 --- /dev/null +++ b/docs/rules/no-object-keys.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-keys +> disallow the `Object.keys` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.keys` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-keys.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-keys.ts) diff --git a/docs/rules/no-object-preventextensions.md b/docs/rules/no-object-preventextensions.md new file mode 100644 index 00000000..3804e4b1 --- /dev/null +++ b/docs/rules/no-object-preventextensions.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-preventextensions +> disallow the `Object.preventExtensions` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.preventExtensions` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-preventextensions.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-preventextensions.ts) diff --git a/docs/rules/no-object-seal.md b/docs/rules/no-object-seal.md new file mode 100644 index 00000000..df93fe1a --- /dev/null +++ b/docs/rules/no-object-seal.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-seal +> disallow the `Object.seal` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `Object.seal` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-seal.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-seal.ts) diff --git a/docs/rules/no-object-setprototypeof.md b/docs/rules/no-object-setprototypeof.md new file mode 100644 index 00000000..1f4df73a --- /dev/null +++ b/docs/rules/no-object-setprototypeof.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-setprototypeof +> disallow the `Object.setPrototypeOf` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Object.setPrototypeOf` as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-setprototypeof.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-setprototypeof.ts) diff --git a/docs/rules/no-object-super-properties.md b/docs/rules/no-object-super-properties.md new file mode 100644 index 00000000..f3c42086 --- /dev/null +++ b/docs/rules/no-object-super-properties.md @@ -0,0 +1,23 @@ +# es-roikoren/no-object-super-properties +> disallow `super` property accesses in object literals. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `super` property accesses in object literals as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-super-properties.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-super-properties.ts) diff --git a/docs/rules/no-object-values.md b/docs/rules/no-object-values.md new file mode 100644 index 00000000..db61be66 --- /dev/null +++ b/docs/rules/no-object-values.md @@ -0,0 +1,19 @@ +# es-roikoren/no-object-values +> disallow the `Object.values` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +This rule reports ES2017 `Object.values` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-object-values.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-object-values.ts) diff --git a/docs/rules/no-octal-numeric-literals.md b/docs/rules/no-octal-numeric-literals.md new file mode 100644 index 00000000..bb8ce68f --- /dev/null +++ b/docs/rules/no-octal-numeric-literals.md @@ -0,0 +1,19 @@ +# es-roikoren/no-octal-numeric-literals +> disallow octal numeric literals. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 octal numeric literals as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-octal-numeric-literals.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-octal-numeric-literals.ts) diff --git a/docs/rules/no-optional-catch-binding.md b/docs/rules/no-optional-catch-binding.md new file mode 100644 index 00000000..947df8ea --- /dev/null +++ b/docs/rules/no-optional-catch-binding.md @@ -0,0 +1,23 @@ +# es-roikoren/no-optional-catch-binding +> disallow optional `catch` binding. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` + +This rule reports ES2019 optional `catch` binding as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-optional-catch-binding.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-optional-catch-binding.ts) diff --git a/docs/rules/no-optional-chaining.md b/docs/rules/no-optional-chaining.md new file mode 100644 index 00000000..789def37 --- /dev/null +++ b/docs/rules/no-optional-chaining.md @@ -0,0 +1,31 @@ +# es-roikoren/no-optional-chaining +> disallow optional chaining. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [Optional Chaining](https://github.com/tc39/proposal-optional-chaining) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +👌 Examples of **correct** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-optional-chaining.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-optional-chaining.ts) diff --git a/docs/rules/no-promise-all-settled.md b/docs/rules/no-promise-all-settled.md new file mode 100644 index 00000000..6af394d9 --- /dev/null +++ b/docs/rules/no-promise-all-settled.md @@ -0,0 +1,19 @@ +# es-roikoren/no-promise-all-settled +> disallow `Promise.allSettled` function. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [`Promise.allSettled` function](https://github.com/tc39/proposal-promise-allSettled) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-promise-all-settled.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-promise-all-settled.ts) diff --git a/docs/rules/no-promise-any.md b/docs/rules/no-promise-any.md new file mode 100644 index 00000000..0901279c --- /dev/null +++ b/docs/rules/no-promise-any.md @@ -0,0 +1,27 @@ +# es-roikoren/no-promise-any +> disallow `Promise.any` function and `AggregateError` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-esnext` + +This rule reports ES2021 [`Promise.any`](https://github.com/tc39/proposal-promise-any) as errors. +This proposal includes the following two: + +- `Promise.any` function +- `AggregateError` class + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-promise-any.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-promise-any.ts) diff --git a/docs/rules/no-promise-prototype-finally.md b/docs/rules/no-promise-prototype-finally.md new file mode 100644 index 00000000..bd1a5be0 --- /dev/null +++ b/docs/rules/no-promise-prototype-finally.md @@ -0,0 +1,35 @@ +# es-roikoren/no-promise-prototype-finally +> disallow the `Promise.prototype.finally` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [`Promise.prototype.finally` method](https://github.com/tc39/proposal-promise-finally) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-promise-prototype-finally: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-promise-prototype-finally.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-promise-prototype-finally.ts) diff --git a/docs/rules/no-promise.md b/docs/rules/no-promise.md new file mode 100644 index 00000000..b90650f8 --- /dev/null +++ b/docs/rules/no-promise.md @@ -0,0 +1,19 @@ +# es-roikoren/no-promise +> disallow the `Promise` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Promise` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-promise.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-promise.ts) diff --git a/docs/rules/no-property-shorthands.md b/docs/rules/no-property-shorthands.md new file mode 100644 index 00000000..f830e44c --- /dev/null +++ b/docs/rules/no-property-shorthands.md @@ -0,0 +1,23 @@ +# es-roikoren/no-property-shorthands +> disallow property shorthands. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2015 property shorthands as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-property-shorthands.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-property-shorthands.ts) diff --git a/docs/rules/no-proxy.md b/docs/rules/no-proxy.md new file mode 100644 index 00000000..c659861d --- /dev/null +++ b/docs/rules/no-proxy.md @@ -0,0 +1,19 @@ +# es-roikoren/no-proxy +> disallow the `Proxy` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Proxy` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-proxy.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-proxy.ts) diff --git a/docs/rules/no-reflect.md b/docs/rules/no-reflect.md new file mode 100644 index 00000000..0304eddd --- /dev/null +++ b/docs/rules/no-reflect.md @@ -0,0 +1,19 @@ +# es-roikoren/no-reflect +> disallow the `Reflect` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Reflect` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-reflect.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-reflect.ts) diff --git a/docs/rules/no-regexp-lookbehind-assertions.md b/docs/rules/no-regexp-lookbehind-assertions.md new file mode 100644 index 00000000..e8306611 --- /dev/null +++ b/docs/rules/no-regexp-lookbehind-assertions.md @@ -0,0 +1,20 @@ +# es-roikoren/no-regexp-lookbehind-assertions +> disallow RegExp lookbehind assertions. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [RegExp lookbehind assertions](https://github.com/tc39/proposal-regexp-lookbehind#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-lookbehind-assertions.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-lookbehind-assertions.ts) diff --git a/docs/rules/no-regexp-named-capture-groups.md b/docs/rules/no-regexp-named-capture-groups.md new file mode 100644 index 00000000..eddc3b11 --- /dev/null +++ b/docs/rules/no-regexp-named-capture-groups.md @@ -0,0 +1,19 @@ +# es-roikoren/no-regexp-named-capture-groups +> disallow RegExp named capture groups. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [RegExp named capture groups](https://github.com/tc39/proposal-regexp-named-groups#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-named-capture-groups.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-named-capture-groups.ts) diff --git a/docs/rules/no-regexp-prototype-flags.md b/docs/rules/no-regexp-prototype-flags.md new file mode 100644 index 00000000..41438cc6 --- /dev/null +++ b/docs/rules/no-regexp-prototype-flags.md @@ -0,0 +1,36 @@ +# es-roikoren/no-regexp-prototype-flags +> disallow the `RegExp.prototype.flags` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `RegExp.prototype.flags` property as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-regexp-prototype-flags: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-prototype-flags.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-prototype-flags.ts) diff --git a/docs/rules/no-regexp-s-flag.md b/docs/rules/no-regexp-s-flag.md new file mode 100644 index 00000000..76cf53d3 --- /dev/null +++ b/docs/rules/no-regexp-s-flag.md @@ -0,0 +1,19 @@ +# es-roikoren/no-regexp-s-flag +> disallow RegExp `s` flag. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [RegExp `s` flag](https://github.com/tc39/proposal-regexp-dotall-flag#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-s-flag.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-s-flag.ts) diff --git a/docs/rules/no-regexp-u-flag.md b/docs/rules/no-regexp-u-flag.md new file mode 100644 index 00000000..4566eb5c --- /dev/null +++ b/docs/rules/no-regexp-u-flag.md @@ -0,0 +1,19 @@ +# es-roikoren/no-regexp-u-flag +> disallow RegExp `u` flag. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 RegExp `u` flag as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-u-flag.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-u-flag.ts) diff --git a/docs/rules/no-regexp-unicode-property-escapes-2019.md b/docs/rules/no-regexp-unicode-property-escapes-2019.md new file mode 100644 index 00000000..64040d48 --- /dev/null +++ b/docs/rules/no-regexp-unicode-property-escapes-2019.md @@ -0,0 +1,38 @@ +# es-roikoren/no-regexp-unicode-property-escapes-2019 +> disallow the new values of RegExp Unicode property escape sequences in ES2019. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` + +This rule reports the new values of ES2018 [RegExp Unicode property escape sequences](https://github.com/tc39/proposal-regexp-unicode-property-escapes#readme) which were added in ES2019. + +For example, the following patterns are valid in ES2019, but syntax error in ES2018 environments: + +- `\p{Extended_Pictographic}` +- `\p{Script=Dogr}` +- `\p{Script=Dogra}` +- `\p{Script=Gong}` +- `\p{Script=Gunjala_Gondi}` +- `\p{Script=Hanifi_Rohingya}` +- `\p{Script=Maka}` +- `\p{Script=Makasar}` +- `\p{Script=Medefaidrin}` +- `\p{Script=Medf}` +- `\p{Script=Old_Sogdian}` +- `\p{Script=Rohg}` +- `\p{Script=Sogd}` +- `\p{Script=Sogdian}` +- `\p{Script=Sogo}` + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-unicode-property-escapes-2019.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-unicode-property-escapes-2019.ts) diff --git a/docs/rules/no-regexp-unicode-property-escapes.md b/docs/rules/no-regexp-unicode-property-escapes.md new file mode 100644 index 00000000..36f3fd61 --- /dev/null +++ b/docs/rules/no-regexp-unicode-property-escapes.md @@ -0,0 +1,19 @@ +# es-roikoren/no-regexp-unicode-property-escapes +> disallow RegExp Unicode property escape sequences. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [RegExp Unicode property escape sequences](https://github.com/tc39/proposal-regexp-unicode-property-escapes#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-unicode-property-escapes.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-unicode-property-escapes.ts) diff --git a/docs/rules/no-regexp-y-flag.md b/docs/rules/no-regexp-y-flag.md new file mode 100644 index 00000000..67b4a57c --- /dev/null +++ b/docs/rules/no-regexp-y-flag.md @@ -0,0 +1,19 @@ +# es-roikoren/no-regexp-y-flag +> disallow RegExp `y` flag. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 RegExp `y` flag as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-regexp-y-flag.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-regexp-y-flag.ts) diff --git a/docs/rules/no-rest-parameters.md b/docs/rules/no-rest-parameters.md new file mode 100644 index 00000000..508a3ba4 --- /dev/null +++ b/docs/rules/no-rest-parameters.md @@ -0,0 +1,23 @@ +# es-roikoren/no-rest-parameters +> disallow rest parameters. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 rest parameters as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-rest-parameters.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-rest-parameters.ts) diff --git a/docs/rules/no-rest-spread-properties.md b/docs/rules/no-rest-spread-properties.md new file mode 100644 index 00000000..489a4b24 --- /dev/null +++ b/docs/rules/no-rest-spread-properties.md @@ -0,0 +1,22 @@ +# es-roikoren/no-rest-spread-properties +> disallow rest/spread properties. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2018`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, and `plugin:es-roikoren/restrict-to-es2017` + +This rule reports ES2018 [rest/spread properties](https://github.com/tc39/proposal-object-rest-spread#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-rest-spread-properties.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-rest-spread-properties.ts) diff --git a/docs/rules/no-set.md b/docs/rules/no-set.md new file mode 100644 index 00000000..7b229d37 --- /dev/null +++ b/docs/rules/no-set.md @@ -0,0 +1,19 @@ +# es-roikoren/no-set +> disallow the `Set` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Set` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-set.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-set.ts) diff --git a/docs/rules/no-shared-array-buffer.md b/docs/rules/no-shared-array-buffer.md new file mode 100644 index 00000000..3d0219cc --- /dev/null +++ b/docs/rules/no-shared-array-buffer.md @@ -0,0 +1,19 @@ +# es-roikoren/no-shared-array-buffer +> disallow the `SharedArrayBuffer` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +This rule reports ES2017 `SharedArrayBuffer` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-shared-array-buffer.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-shared-array-buffer.ts) diff --git a/docs/rules/no-spread-elements.md b/docs/rules/no-spread-elements.md new file mode 100644 index 00000000..146d7d02 --- /dev/null +++ b/docs/rules/no-spread-elements.md @@ -0,0 +1,20 @@ +# es-roikoren/no-spread-elements +> disallow spread elements. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 spread elements as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-spread-elements.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-spread-elements.ts) diff --git a/docs/rules/no-string-fromcodepoint.md b/docs/rules/no-string-fromcodepoint.md new file mode 100644 index 00000000..67e233a7 --- /dev/null +++ b/docs/rules/no-string-fromcodepoint.md @@ -0,0 +1,19 @@ +# es-roikoren/no-string-fromcodepoint +> disallow the `String.fromCodePoint` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.fromCodePoint` as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-fromcodepoint.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-fromcodepoint.ts) diff --git a/docs/rules/no-string-prototype-codepointat.md b/docs/rules/no-string-prototype-codepointat.md new file mode 100644 index 00000000..5ade5b1b --- /dev/null +++ b/docs/rules/no-string-prototype-codepointat.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-codepointat +> disallow the `String.prototype.codePointAt` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.prototype.codePointAt` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-codepointat: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-codepointat.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-codepointat.ts) diff --git a/docs/rules/no-string-prototype-endswith.md b/docs/rules/no-string-prototype-endswith.md new file mode 100644 index 00000000..8a0e247e --- /dev/null +++ b/docs/rules/no-string-prototype-endswith.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-endswith +> disallow the `String.prototype.endsWith` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.prototype.endsWith` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-endswith: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-endswith.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-endswith.ts) diff --git a/docs/rules/no-string-prototype-includes.md b/docs/rules/no-string-prototype-includes.md new file mode 100644 index 00000000..b1af7de4 --- /dev/null +++ b/docs/rules/no-string-prototype-includes.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-includes +> disallow the `String.prototype.includes` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.prototype.includes` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-includes: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-includes.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-includes.ts) diff --git a/docs/rules/no-string-prototype-matchall.md b/docs/rules/no-string-prototype-matchall.md new file mode 100644 index 00000000..ea5cee7e --- /dev/null +++ b/docs/rules/no-string-prototype-matchall.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-matchall +> disallow the `String.prototype.matchAll` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2020`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, `plugin:es-roikoren/restrict-to-es2018`, and `plugin:es-roikoren/restrict-to-es2019` + +This rule reports ES2020 [`String.prototype.matchAll` method](https://github.com/tc39/proposal-string-matchall) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-matchall: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-matchall.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-matchall.ts) diff --git a/docs/rules/no-string-prototype-normalize.md b/docs/rules/no-string-prototype-normalize.md new file mode 100644 index 00000000..1684d9b6 --- /dev/null +++ b/docs/rules/no-string-prototype-normalize.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-normalize +> disallow the `String.prototype.normalize` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.prototype.normalize` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-normalize: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-normalize.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-normalize.ts) diff --git a/docs/rules/no-string-prototype-padstart-padend.md b/docs/rules/no-string-prototype-padstart-padend.md new file mode 100644 index 00000000..5fdeedcc --- /dev/null +++ b/docs/rules/no-string-prototype-padstart-padend.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-padstart-padend +> disallow the `String.prototype.{padStart,padEnd}` methods. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` + +This rule reports ES2017 [`String.prototype.{padStart,padEnd}` methods](https://github.com/tc39/proposal-string-pad-start-end) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-padstart-padend: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-padstart-padend.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-padstart-padend.ts) diff --git a/docs/rules/no-string-prototype-repeat.md b/docs/rules/no-string-prototype-repeat.md new file mode 100644 index 00000000..a49d1794 --- /dev/null +++ b/docs/rules/no-string-prototype-repeat.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-repeat +> disallow the `String.prototype.repeat` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.prototype.repeat` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-repeat: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-repeat.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-repeat.ts) diff --git a/docs/rules/no-string-prototype-replaceall.md b/docs/rules/no-string-prototype-replaceall.md new file mode 100644 index 00000000..f79f948a --- /dev/null +++ b/docs/rules/no-string-prototype-replaceall.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-replaceall +> disallow the `String.prototype.replaceAll` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-esnext` + +This rule reports ES2021 [`String.prototype.replaceAll` method](https://github.com/tc39/proposal-string-replaceall) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-replaceall: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-replaceall.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-replaceall.ts) diff --git a/docs/rules/no-string-prototype-startswith.md b/docs/rules/no-string-prototype-startswith.md new file mode 100644 index 00000000..e6debe4b --- /dev/null +++ b/docs/rules/no-string-prototype-startswith.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-startswith +> disallow the `String.prototype.startsWith` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.prototype.startsWith` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-startswith: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-startswith.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-startswith.ts) diff --git a/docs/rules/no-string-prototype-trim.md b/docs/rules/no-string-prototype-trim.md new file mode 100644 index 00000000..b41fec37 --- /dev/null +++ b/docs/rules/no-string-prototype-trim.md @@ -0,0 +1,35 @@ +# es-roikoren/no-string-prototype-trim +> disallow the `String.prototype.trim` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 `String.prototype.trim` method as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-trim: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-trim.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-trim.ts) diff --git a/docs/rules/no-string-prototype-trimstart-trimend.md b/docs/rules/no-string-prototype-trimstart-trimend.md new file mode 100644 index 00000000..4ba8e250 --- /dev/null +++ b/docs/rules/no-string-prototype-trimstart-trimend.md @@ -0,0 +1,36 @@ +# es-roikoren/no-string-prototype-trimstart-trimend +> disallow the `String.prototype.{trimStart,trimEnd}` methods. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` + +This rule reports ES2019 [`String.prototype.{trimStart,trimEnd}` methods](https://github.com/tc39/proposal-string-left-right-trim) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-string-prototype-trimstart-trimend: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-prototype-trimstart-trimend.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-prototype-trimstart-trimend.ts) diff --git a/docs/rules/no-string-raw.md b/docs/rules/no-string-raw.md new file mode 100644 index 00000000..dab7ea9d --- /dev/null +++ b/docs/rules/no-string-raw.md @@ -0,0 +1,19 @@ +# es-roikoren/no-string-raw +> disallow the `String.raw` method. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `String.raw` method as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-string-raw.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-string-raw.ts) diff --git a/docs/rules/no-subclassing-builtins.md b/docs/rules/no-subclassing-builtins.md new file mode 100644 index 00000000..653b8638 --- /dev/null +++ b/docs/rules/no-subclassing-builtins.md @@ -0,0 +1,34 @@ +# es-roikoren/no-subclassing-builtins +> disallow the subclassing of the built-in classes. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 subclassing of built-in classes as errors. + +The built-in classes include the following classes (constructors): + +- `Array` +- `Boolean` +- `Error` +- `RegExp` +- `Function` +- `Map` +- `Number` +- `Promise` +- `Set` +- `String` + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-subclassing-builtins.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-subclassing-builtins.ts) diff --git a/docs/rules/no-symbol-prototype-description.md b/docs/rules/no-symbol-prototype-description.md new file mode 100644 index 00000000..66d11107 --- /dev/null +++ b/docs/rules/no-symbol-prototype-description.md @@ -0,0 +1,35 @@ +# es-roikoren/no-symbol-prototype-description +> disallow the `Symbol.prototype.description` property. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2019`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, `plugin:es-roikoren/restrict-to-es2016`, `plugin:es-roikoren/restrict-to-es2017`, and `plugin:es-roikoren/restrict-to-es2018` + +This rule reports ES2019 [`Symbol.prototype.description` property](https://github.com/tc39/proposal-Symbol-description) as errors. + +This rule is silent by default because it's hard to know types. You need to configure [the aggressive mode](../#the-aggressive-mode) or TypeScript in order to enable this rule. + +## 💡 Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 🔧 Options + +This rule has an option. + +```yml +rules: + es-roikoren/no-symbol-prototype-description: [error, { aggressive: false }] +``` + +### aggressive: boolean + +Configure the aggressive mode for only this rule. +This is prior to the `settings.es.aggressive` setting. + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-symbol-prototype-description.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-symbol-prototype-description.ts) diff --git a/docs/rules/no-symbol.md b/docs/rules/no-symbol.md new file mode 100644 index 00000000..afc604db --- /dev/null +++ b/docs/rules/no-symbol.md @@ -0,0 +1,19 @@ +# es-roikoren/no-symbol +> disallow the `Symbol` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `Symbol` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-symbol.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-symbol.ts) diff --git a/docs/rules/no-template-literals.md b/docs/rules/no-template-literals.md new file mode 100644 index 00000000..41424788 --- /dev/null +++ b/docs/rules/no-template-literals.md @@ -0,0 +1,29 @@ +# es-roikoren/no-template-literals +> disallow template literals. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2015 template literals as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +👌 Examples of **correct** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-template-literals.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-template-literals.ts) diff --git a/docs/rules/no-trailing-commas.md b/docs/rules/no-trailing-commas.md new file mode 100644 index 00000000..ef71541f --- /dev/null +++ b/docs/rules/no-trailing-commas.md @@ -0,0 +1,20 @@ +# es-roikoren/no-trailing-commas +> disallow trailing commas in array/object literals. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es5` and `plugin:es-roikoren/restrict-to-es3` + +This rule reports ES5 trailing commas in array/object literals as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-trailing-commas.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-trailing-commas.ts) diff --git a/docs/rules/no-trailing-function-commas.md b/docs/rules/no-trailing-function-commas.md new file mode 100644 index 00000000..644f231f --- /dev/null +++ b/docs/rules/no-trailing-function-commas.md @@ -0,0 +1,27 @@ +# es-roikoren/no-trailing-function-commas +> disallow trailing commas in parameter/argument lists. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2017`, `plugin:es-roikoren/restrict-to-es3`, `plugin:es-roikoren/restrict-to-es5`, `plugin:es-roikoren/restrict-to-es2015`, and `plugin:es-roikoren/restrict-to-es2016` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2017 [trailing commas in parameter/argument lists](https://github.com/tc39/proposal-trailing-function-commas#readme) as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-trailing-function-commas.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-trailing-function-commas.ts) diff --git a/docs/rules/no-typed-arrays.md b/docs/rules/no-typed-arrays.md new file mode 100644 index 00000000..a0628544 --- /dev/null +++ b/docs/rules/no-typed-arrays.md @@ -0,0 +1,30 @@ +# es-roikoren/no-typed-arrays +> disallow ES2015 typed arrays. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 typed arrays as errors. + +- `Int8Array` +- `Uint8Array` +- `Uint8ClampedArray` +- `Int16Array` +- `Uint16Array` +- `Int32Array` +- `Uint32Array` +- `Float32Array` +- `Float64Array` +- `DataView` + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-typed-arrays.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-typed-arrays.ts) diff --git a/docs/rules/no-unicode-codepoint-escapes.md b/docs/rules/no-unicode-codepoint-escapes.md new file mode 100644 index 00000000..470a563b --- /dev/null +++ b/docs/rules/no-unicode-codepoint-escapes.md @@ -0,0 +1,28 @@ +# es-roikoren/no-unicode-codepoint-escapes +> disallow Unicode code point escape sequences. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` +- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule reports ES2015 Unicode code point escape sequences as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +👌 Examples of **correct** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-unicode-codepoint-escapes.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-unicode-codepoint-escapes.ts) diff --git a/docs/rules/no-weak-map.md b/docs/rules/no-weak-map.md new file mode 100644 index 00000000..c6c5337f --- /dev/null +++ b/docs/rules/no-weak-map.md @@ -0,0 +1,19 @@ +# es-roikoren/no-weak-map +> disallow the `WeakMap` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `WeakMap` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-weak-map.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-weak-map.ts) diff --git a/docs/rules/no-weak-set.md b/docs/rules/no-weak-set.md new file mode 100644 index 00000000..a03f4bbe --- /dev/null +++ b/docs/rules/no-weak-set.md @@ -0,0 +1,19 @@ +# es-roikoren/no-weak-set +> disallow the `WeakSet` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-es2015`, `plugin:es-roikoren/restrict-to-es3`, and `plugin:es-roikoren/restrict-to-es5` + +This rule reports ES2015 `WeakSet` class as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-weak-set.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-weak-set.ts) diff --git a/docs/rules/no-weakrefs.md b/docs/rules/no-weakrefs.md new file mode 100644 index 00000000..59c4d0f0 --- /dev/null +++ b/docs/rules/no-weakrefs.md @@ -0,0 +1,24 @@ +# es-roikoren/no-weakrefs +> disallow the `WeakRef` and `FinalizationRegistry` class. + +- ✅ The following configurations enable this rule: `plugin:es-roikoren/no-new-in-esnext` + +This rule reports ES2021 [WeakRefs](https://github.com/tc39/proposal-weakrefs) as errors. +This proposal includes the following two: + +- `WeakRef` class +- `FinalizationRegistry` class + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/src/rules/no-weakrefs.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v0.0.0/tests/src/rules/no-weakrefs.ts) diff --git a/index.ts b/index.ts new file mode 100644 index 00000000..4f36ee13 --- /dev/null +++ b/index.ts @@ -0,0 +1 @@ +/* eslint-disable unicorn/no-empty-file */ diff --git a/package.json b/package.json new file mode 100644 index 00000000..8cb474ba --- /dev/null +++ b/package.json @@ -0,0 +1,84 @@ +{ + "name": "eslint-plugin-es-roikoren", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "ssh://git@github.com/roikoren755/eslint-plugin-es.git" + }, + "author": "Roi Koren", + "eslintIgnore": [ + "dist", + "node_modules" + ], + "license": "MIT", + "main": "./src/index.js", + "files": [ + "**/*.js" + ], + "scripts": { + "build": "tsc", + "clean": "tsc --build --clean && rimraf .nyc_output coverage", + "coverage": "nyc report -r lcov", + "deduplicate": "yarn-deduplicate -s fewer", + "lint": "eslint . --cache", + "new": "ts-node scripts/new-rule", + "prepare": "husky install", + "prerelease": "yarn build", + "release": "changeset publish", + "test": "nyc mocha tests/**/*.ts --reporter dot", + "type": "tsc --noEmit --noImplicitAny", + "update": "yarn lint --fix && yarn update:configs && yarn update:index && yarn update:doc && yarn update:ruledocs", + "update:configs": "ts-node scripts/update-src-configs", + "update:doc": "ts-node scripts/update-docs-readme", + "update:index": "ts-node scripts/update-src-index", + "update:ruledocs": "ts-node scripts/update-docs-rules", + "watch": "mocha tests/**/*.js --reporter progress --watch --growl" + }, + "resolutions": { + "prettier": "2.4.1" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": "5.3.0", + "regexpp": "3.2.0" + }, + "devDependencies": { + "@changesets/changelog-github": "0.4.1", + "@changesets/cli": "2.18.0", + "@commitlint/cli": "14.1.0", + "@commitlint/config-conventional": "14.1.0", + "@types/eslint": "7.28.2", + "@types/is-core-module": "2.2.0", + "@types/minimatch": "3.0.5", + "@types/resolve": "1.20.1", + "@types/semver": "7.3.9", + "@typescript-eslint/eslint-plugin": "5.3.1", + "@typescript-eslint/parser": "5.3.1", + "@typescript-eslint/types": "5.3.1", + "@typescript-eslint/typescript-estree": "5.3.1", + "camelcase": "6.2.0", + "eslint": "8.2.0", + "eslint-config-prettier": "8.3.0", + "eslint-import-resolver-alias": "1.1.2", + "eslint-import-resolver-typescript": "2.5.0", + "eslint-plugin-es-roikoren": "file:.", + "eslint-plugin-eslint-plugin": "4.0.2", + "eslint-plugin-import": "2.25.2", + "eslint-plugin-prettier": "4.0.0", + "eslint-plugin-unicorn": "38.0.1", + "globals": "13.12.0", + "husky": "7.0.4", + "lint-staged": "11.2.6", + "mocha": "9.1.3", + "nyc": "15.1.0", + "prettier": "2.4.1", + "semver": "7.3.5", + "type-fest": "2.5.3", + "typescript": "4.4.4", + "yarn-deduplicate": "3.1.0" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx}": [ + "eslint --quiet --cache" + ] + } +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..5be801b2 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "extends": ["config:base", ":preserveSemverRanges"], + "semanticCommits": "enabled", + "dependencyDashboard": true, + "postUpdateOptions": ["yarnDedupeFewer"] +} diff --git a/scripts/new-rule.ts b/scripts/new-rule.ts new file mode 100644 index 00000000..819fce91 --- /dev/null +++ b/scripts/new-rule.ts @@ -0,0 +1,79 @@ +import { execSync } from 'child_process'; +import { writeFileSync } from 'fs'; +import path from 'path'; + +((ruleId: string): void => { + if (!ruleId) { + console.error('Usage: npm run new '); + process.exitCode = 1; + + return; + } + + if (!/^[a-z0-9-]+$/u.test(ruleId)) { + console.error("Invalid RuleID '%s'.", ruleId); + process.exitCode = 1; + + return; + } + + const ruleFile = path.resolve(__dirname, `../src/rules/${ruleId}.ts`); + const testFile = path.resolve(__dirname, `../tests/src/rules/${ruleId}.ts`); + const docFile = path.resolve(__dirname, `../docs/rules/${ruleId}.md`); + + writeFileSync( + ruleFile, + `import { createRule } from '../utils/create-rule'; + +export const category = 'ES2021'; +export default createRule<[], 'forbidden'>({ + name: '${ruleId}', + meta: { + type: 'problem', + docs: { description: '', recommended: false }, + schema: [], + messages: { forbidden: '' }, + }, + defaultOptions: [], + create(context) { + return {}; + }, +}); +`, + ); + writeFileSync( + testFile, + `import { RuleTester } = from '../../tester'; +import rule from '../../../src/rules/${ruleId}'; + +if (!RuleTester.isSupported(2021)) { + console.log('Skip the tests of ${ruleId}.'); +} else { + new RuleTester().run('${ruleId}', rule, { + valid: [], + invalid: [], + }); +} +`, + ); + writeFileSync( + docFile, + `# es-roikoren/${ruleId} +> + +This rule reports ??? as errors. + +## Examples + +⛔ Examples of **incorrect** code for this rule: + + +`, + ); + + execSync(`code "${ruleFile}"`); + execSync(`code "${testFile}"`); + execSync(`code "${docFile}"`); +})(process.argv[2]); diff --git a/scripts/rules.ts b/scripts/rules.ts new file mode 100644 index 00000000..d9c49dde --- /dev/null +++ b/scripts/rules.ts @@ -0,0 +1,76 @@ +import { readdirSync } from 'fs'; +import path from 'path'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; + +const libRoot = path.resolve(__dirname, '../src/rules'); + +export interface IRule { + ruleId: string; + description: string; + fixable: boolean; +} + +export interface ICategory { + id: string; + revision: number; + configName?: string; + aboveConfigName?: string; + rules: IRule[]; + experimental?: boolean; +} + +const categories = [12, 11, 10, 9, 8, 7, 6, 5].reduce>((map, revision, _, [latest]) => { + const year = revision <= 5 ? 5 : 2009 + revision; + const id = `ES${year}`; + + map[id] = { + id, + revision, + rules: [], + experimental: revision === latest, + }; + + return map; +}, {}); + +const rules: IRule[] = []; + +(function walk(dirPath) { + for (const entry of readdirSync(dirPath, { withFileTypes: true })) { + if (entry.isDirectory()) { + walk(path.join(dirPath, entry.name)); + // eslint-disable-next-line no-continue + continue; + } + + const filePath = path.join(dirPath, entry.name); + const ruleId = path.relative(libRoot, filePath).replace(/\.ts$/u, '').replace(/\\/gu, '/'); + + // eslint-disable-next-line @typescript-eslint/no-var-requires + const content = require(path.join(dirPath, entry.name)) as { + default: TSESLint.RuleModule<'forbidden', []>; + category: string; + }; + + const { + category, + default: { + meta: { docs, fixable }, + }, + } = content; + const description = docs?.description; + const rule = { + ruleId, + description: description ?? '', + fixable: !!fixable, + }; + + if (category) { + categories[category].rules.push(rule); + } + + rules.push(rule); + } +})(libRoot); + +export { categories, rules }; diff --git a/scripts/update-docs-readme.ts b/scripts/update-docs-readme.ts new file mode 100644 index 00000000..6c20244d --- /dev/null +++ b/scripts/update-docs-readme.ts @@ -0,0 +1,110 @@ +import { readdirSync, writeFileSync } from 'fs'; +import path from 'path'; +import type { ICategory, IRule } from './rules'; +import { categories } from './rules'; + +const collator = new Intl.Collator('en', { numeric: true }); + +const extractCategoryId = (filePath: string): string => { + const basename = path.basename(filePath, '.ts'); + const match = /no-new-in-(es\d+)/u.exec(basename); + + return match?.[1].toUpperCase() ?? ''; +}; + +/** + * Format a list. + * @param {string[]} xs The list value to format. + */ +export const formatList = (xs: string[]): string => { + switch (xs.length) { + case 0: + return ''; + case 1: + return xs[0]; + case 2: + return `${xs[0]} and ${xs[1]}`; + default: { + const ys = xs.slice(0, -1); + const last = xs[xs.length - 1]; + + return `${ys.join(', ')}, and ${last}`; + } + } +}; + +// Analyze configs +const configRoot = path.resolve(__dirname, '../src/configs/'); +const configs = readdirSync(configRoot).map((filename) => { + const id = `plugin:es-roikoren/${path.basename(filename, '.ts')}`; + const configFile = path.join(configRoot, filename); + const categoryIds = [ + extractCategoryId(configFile), + // eslint-disable-next-line @typescript-eslint/no-var-requires + ...((require(configFile) as { default: { extends?: string[] } }).default.extends ?? []).map((filePath) => + extractCategoryId(filePath), + ), + ].filter(Boolean); + + return { id, categoryIds }; +}); + +/** + * Create markdown text for a rule. + * @param {IRule} rule The rule information to convert. + */ +const toTableRow = ({ ruleId, description, fixable }: IRule): string => { + const title = `[es-roikoren/${ruleId}](./${ruleId}.md)`; + const icons = fixable ? '🔧' : ''; + + return `| ${title} | ${description} | ${icons} |`; +}; + +/** + * Create markdown text for a category. + * @param {ICategory} category The category information to convert. + */ +const toTable = ({ rules }: ICategory): string => `| Rule ID | Description | | +|:--------|:------------|:--:| +${rules.map((rule) => toTableRow(rule)).join('\n')}`; + +/** + * Create markdown text for a category. + * @param {string} categoryId The category ID to convert. + */ +const toSection = (categoryId: string): string => { + const configIds = formatList( + configs + .filter((c) => c.categoryIds.includes(categoryId)) + .map((c) => `\`${c.id}\``) + .sort(collator.compare.bind(collator)), + ); + const comment = configIds + ? `There are multiple configs that enable all rules in this category: ${configIds}` + : 'There is a config that enables the rules in this category: `plugin:es-roikoren/no-new-in-esnext`'; + + return `## ${categoryId} + +${comment} + +${toTable(categories[categoryId])} +`; +}; + +// Convert categories to README sections +const ruleSectionContent = Object.keys(categories) + .map((category) => toSection(category)) + .join('\n'); + +// Write README.md +writeFileSync( + 'docs/rules/README.md', + `# Available Rules + +This plugin provides the following rules. + +- 🔧 mark means that the \`--fix\` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by the rule. + +${ruleSectionContent} +`, +); diff --git a/scripts/update-docs-rules.ts b/scripts/update-docs-rules.ts new file mode 100644 index 00000000..d2526903 --- /dev/null +++ b/scripts/update-docs-rules.ts @@ -0,0 +1,78 @@ +import { readFileSync, readdirSync, writeFileSync } from 'fs'; +import path from 'path'; +import { TSESLint } from '@typescript-eslint/experimental-utils'; + +import { version } from '../package.json'; +import { rules } from './rules'; +import { formatList } from './update-docs-readme'; + +const run = async (): Promise => { + const docsRoot = path.resolve(__dirname, '../docs/rules/'); + const configRoot = path.resolve(__dirname, '../src/configs/'); + const getRules = async (filename: string): Promise> => { + const { + default: { extends: otherConfigs, ...overrideConfig }, + } = (await import(filename.startsWith('/') ? filename : path.join(configRoot, filename))) as { + default: TSESLint.Linter.ConfigOverride; + }; + + const engine = new TSESLint.ESLint({ overrideConfig, useEslintrc: false }); + const config = await engine.calculateConfigForFile('a.ts'); + const others = otherConfigs ?? []; + const ruleIds = Object.keys(config.rules ?? {}); + + await Promise.all( + (Array.isArray(others) ? others : [others]).map(async (other) => { + ruleIds.push(...(await getRules(other))); + }), + ); + + return new Set(ruleIds); + }; + const configs = await Promise.all( + readdirSync(configRoot).map(async (filename) => { + const id = `plugin:es-roikoren/${path.basename(filename, '.ts')}`; + const ruleIds = await getRules(filename); + + return { id, ruleIds }; + }), + ); + const collator = new Intl.Collator('en', { numeric: true }); + + for (const { ruleId, description, fixable } of rules) { + const filePath = path.join(docsRoot, `${ruleId}.md`); + const content = readFileSync(filePath, 'utf8') + .replace(/^#.+\n>.+\n+(?:- .+\n)*/u, '') + .replace(/## 📚 References[\s\S]+/u, '') + .trim(); + const enabledConfigIds = configs + .filter((c) => c.ruleIds.has(`es-roikoren/${ruleId}`)) + .map((c) => `\`${c.id}\``) + .sort(collator.compare.bind(collator)); + const headerLines = [`# es-roikoren/${ruleId}`, `> ${description}`, '']; + + if (enabledConfigIds.length > 0) { + headerLines.push(`- ✅ The following configurations enable this rule: ${formatList(enabledConfigIds)}`); + } + + if (fixable) { + headerLines.push( + '- 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.', + ); + } + + const newContent = `${headerLines.join('\n').trim()} + +${content} + +## 📚 References + +- [Rule source](https://github.com/roikoren755/eslint-plugin-es/blob/v${version}/src/rules/${ruleId}.ts) +- [Test source](https://github.com/roikoren755/eslint-plugin-es/blob/v${version}/tests/src/rules/${ruleId}.ts) +`; + + writeFileSync(filePath, newContent); + } +}; + +run().catch(console.error); diff --git a/scripts/update-src-configs.ts b/scripts/update-src-configs.ts new file mode 100644 index 00000000..77cae597 --- /dev/null +++ b/scripts/update-src-configs.ts @@ -0,0 +1,57 @@ +import { writeFileSync } from 'fs'; +import path from 'path'; +import { TSESLint } from '@typescript-eslint/experimental-utils'; + +import { categories } from './rules'; + +const Root = path.resolve(__dirname, '../src/configs'); + +const configNameToDisallowNewIn = (revision: number): string => { + const year = revision <= 5 ? revision : 2009 + revision; + + return `no-new-in-es${year}`; +}; + +const configNameToRestrictToPreviousOf = (revision: number): string => { + const prevRev = revision === 5 ? 3 : revision - 1; + const year = prevRev <= 5 ? prevRev : 2009 + prevRev; + + return `restrict-to-es${year}`; +}; + +const wrapCode = (code: string): string => `/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default ${code}; +`; + +const run = async (): Promise => { + for (const { experimental, revision, rules } of Object.values(categories)) { + const ruleSetting = rules.map((r) => `'es-roikoren/${r.ruleId}':'error'`).join(','); + const extendSetting = Object.values(categories) + .filter((c) => c.revision >= revision && !c.experimental) + .map((c) => `require.resolve('./${configNameToDisallowNewIn(c.revision)}')`) + .join(','); + + if (experimental) { + writeFileSync( + path.join(Root, 'no-new-in-esnext.ts'), + wrapCode(`{ plugins: ['es-roikoren'], rules: { ${ruleSetting} } }`), + ); + } else { + writeFileSync( + path.join(Root, `${configNameToDisallowNewIn(revision)}.ts`), + wrapCode(`{ plugins: ['es-roikoren'], rules: { ${ruleSetting} } }`), + ); + writeFileSync( + path.join(Root, `${configNameToRestrictToPreviousOf(revision)}.ts`), + wrapCode(`{ extends: [${extendSetting}] }`), + ); + } + } + + await TSESLint.ESLint.outputFixes((await new TSESLint.ESLint({ fix: true }).lintFiles(['src/configs'])) as never); +}; + +run().catch(console.error); diff --git a/scripts/update-src-index.ts b/scripts/update-src-index.ts new file mode 100644 index 00000000..99c249e0 --- /dev/null +++ b/scripts/update-src-index.ts @@ -0,0 +1,41 @@ +import fs from 'fs'; +import path from 'path'; +import { TSESLint } from '@typescript-eslint/experimental-utils'; +import camelcase from 'camelcase'; + +import { rules } from './rules'; + +const run = async (): Promise => { + const collator = new Intl.Collator('en', { numeric: true }); + + const configRootPath = path.resolve(__dirname, '../src/configs'); + const configIds = fs + .readdirSync(configRootPath) + .map((f) => path.basename(f, '.ts')) + .sort(collator.compare.bind(collator)); + const ruleIds = rules.map((r) => r.ruleId).sort(collator.compare.bind(collator)); + + fs.writeFileSync( + 'src/index.ts', + `/** + * DON'T EDIT THIS FILE. + * This file was generated automatically by 'scripts/update-src-index.ts'. + */ +${configIds.map((id) => `import ${camelcase(id)} from './configs/${id}';`).join('\n')} +${ruleIds.map((id) => `import ${camelcase(id)} from './rules/${id}';`).join('\n')} + +export default { + configs: { + ${configIds.map((id) => `'${id}': ${camelcase(id)}`).join(',')}, + }, + rules: { + ${ruleIds.map((id) => `'${id}': ${camelcase(id)}`).join(',')} + }, +}; +`, + ); + + await TSESLint.ESLint.outputFixes((await new TSESLint.ESLint({ fix: true }).lintFiles(['src/index.ts'])) as never); +}; + +run().catch(console.error); diff --git a/src/configs/no-new-in-es2015.ts b/src/configs/no-new-in-es2015.ts new file mode 100644 index 00000000..5cb5fbe0 --- /dev/null +++ b/src/configs/no-new-in-es2015.ts @@ -0,0 +1,88 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { + 'es-roikoren/no-array-from': 'error', + 'es-roikoren/no-array-of': 'error', + 'es-roikoren/no-array-prototype-copywithin': 'error', + 'es-roikoren/no-array-prototype-entries': 'error', + 'es-roikoren/no-array-prototype-fill': 'error', + 'es-roikoren/no-array-prototype-find': 'error', + 'es-roikoren/no-array-prototype-findindex': 'error', + 'es-roikoren/no-array-prototype-keys': 'error', + 'es-roikoren/no-array-prototype-values': 'error', + 'es-roikoren/no-arrow-functions': 'error', + 'es-roikoren/no-binary-numeric-literals': 'error', + 'es-roikoren/no-block-scoped-functions': 'error', + 'es-roikoren/no-block-scoped-variables': 'error', + 'es-roikoren/no-classes': 'error', + 'es-roikoren/no-computed-properties': 'error', + 'es-roikoren/no-default-parameters': 'error', + 'es-roikoren/no-destructuring': 'error', + 'es-roikoren/no-for-of-loops': 'error', + 'es-roikoren/no-generators': 'error', + 'es-roikoren/no-map': 'error', + 'es-roikoren/no-math-acosh': 'error', + 'es-roikoren/no-math-asinh': 'error', + 'es-roikoren/no-math-atanh': 'error', + 'es-roikoren/no-math-cbrt': 'error', + 'es-roikoren/no-math-clz32': 'error', + 'es-roikoren/no-math-cosh': 'error', + 'es-roikoren/no-math-expm1': 'error', + 'es-roikoren/no-math-fround': 'error', + 'es-roikoren/no-math-hypot': 'error', + 'es-roikoren/no-math-imul': 'error', + 'es-roikoren/no-math-log10': 'error', + 'es-roikoren/no-math-log1p': 'error', + 'es-roikoren/no-math-log2': 'error', + 'es-roikoren/no-math-sign': 'error', + 'es-roikoren/no-math-sinh': 'error', + 'es-roikoren/no-math-tanh': 'error', + 'es-roikoren/no-math-trunc': 'error', + 'es-roikoren/no-modules': 'error', + 'es-roikoren/no-new-target': 'error', + 'es-roikoren/no-number-epsilon': 'error', + 'es-roikoren/no-number-isfinite': 'error', + 'es-roikoren/no-number-isinteger': 'error', + 'es-roikoren/no-number-isnan': 'error', + 'es-roikoren/no-number-issafeinteger': 'error', + 'es-roikoren/no-number-maxsafeinteger': 'error', + 'es-roikoren/no-number-minsafeinteger': 'error', + 'es-roikoren/no-number-parsefloat': 'error', + 'es-roikoren/no-number-parseint': 'error', + 'es-roikoren/no-object-assign': 'error', + 'es-roikoren/no-object-getownpropertysymbols': 'error', + 'es-roikoren/no-object-is': 'error', + 'es-roikoren/no-object-setprototypeof': 'error', + 'es-roikoren/no-object-super-properties': 'error', + 'es-roikoren/no-octal-numeric-literals': 'error', + 'es-roikoren/no-promise': 'error', + 'es-roikoren/no-property-shorthands': 'error', + 'es-roikoren/no-proxy': 'error', + 'es-roikoren/no-reflect': 'error', + 'es-roikoren/no-regexp-prototype-flags': 'error', + 'es-roikoren/no-regexp-u-flag': 'error', + 'es-roikoren/no-regexp-y-flag': 'error', + 'es-roikoren/no-rest-parameters': 'error', + 'es-roikoren/no-set': 'error', + 'es-roikoren/no-spread-elements': 'error', + 'es-roikoren/no-string-fromcodepoint': 'error', + 'es-roikoren/no-string-prototype-codepointat': 'error', + 'es-roikoren/no-string-prototype-endswith': 'error', + 'es-roikoren/no-string-prototype-includes': 'error', + 'es-roikoren/no-string-prototype-normalize': 'error', + 'es-roikoren/no-string-prototype-repeat': 'error', + 'es-roikoren/no-string-prototype-startswith': 'error', + 'es-roikoren/no-string-raw': 'error', + 'es-roikoren/no-subclassing-builtins': 'error', + 'es-roikoren/no-symbol': 'error', + 'es-roikoren/no-template-literals': 'error', + 'es-roikoren/no-typed-arrays': 'error', + 'es-roikoren/no-unicode-codepoint-escapes': 'error', + 'es-roikoren/no-weak-map': 'error', + 'es-roikoren/no-weak-set': 'error', + }, +}; diff --git a/src/configs/no-new-in-es2016.ts b/src/configs/no-new-in-es2016.ts new file mode 100644 index 00000000..1acdb34c --- /dev/null +++ b/src/configs/no-new-in-es2016.ts @@ -0,0 +1,8 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { 'es-roikoren/no-array-prototype-includes': 'error', 'es-roikoren/no-exponential-operators': 'error' }, +}; diff --git a/src/configs/no-new-in-es2017.ts b/src/configs/no-new-in-es2017.ts new file mode 100644 index 00000000..7e93e7c8 --- /dev/null +++ b/src/configs/no-new-in-es2017.ts @@ -0,0 +1,17 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { + 'es-roikoren/no-async-functions': 'error', + 'es-roikoren/no-atomics': 'error', + 'es-roikoren/no-object-entries': 'error', + 'es-roikoren/no-object-getownpropertydescriptors': 'error', + 'es-roikoren/no-object-values': 'error', + 'es-roikoren/no-shared-array-buffer': 'error', + 'es-roikoren/no-string-prototype-padstart-padend': 'error', + 'es-roikoren/no-trailing-function-commas': 'error', + }, +}; diff --git a/src/configs/no-new-in-es2018.ts b/src/configs/no-new-in-es2018.ts new file mode 100644 index 00000000..617a25c3 --- /dev/null +++ b/src/configs/no-new-in-es2018.ts @@ -0,0 +1,17 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { + 'es-roikoren/no-async-iteration': 'error', + 'es-roikoren/no-malformed-template-literals': 'error', + 'es-roikoren/no-promise-prototype-finally': 'error', + 'es-roikoren/no-regexp-lookbehind-assertions': 'error', + 'es-roikoren/no-regexp-named-capture-groups': 'error', + 'es-roikoren/no-regexp-s-flag': 'error', + 'es-roikoren/no-regexp-unicode-property-escapes': 'error', + 'es-roikoren/no-rest-spread-properties': 'error', + }, +}; diff --git a/src/configs/no-new-in-es2019.ts b/src/configs/no-new-in-es2019.ts new file mode 100644 index 00000000..0f56a183 --- /dev/null +++ b/src/configs/no-new-in-es2019.ts @@ -0,0 +1,16 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { + 'es-roikoren/no-array-prototype-flat': 'error', + 'es-roikoren/no-json-superset': 'error', + 'es-roikoren/no-object-fromentries': 'error', + 'es-roikoren/no-optional-catch-binding': 'error', + 'es-roikoren/no-regexp-unicode-property-escapes-2019': 'error', + 'es-roikoren/no-string-prototype-trimstart-trimend': 'error', + 'es-roikoren/no-symbol-prototype-description': 'error', + }, +}; diff --git a/src/configs/no-new-in-es2020.ts b/src/configs/no-new-in-es2020.ts new file mode 100644 index 00000000..b42f2e32 --- /dev/null +++ b/src/configs/no-new-in-es2020.ts @@ -0,0 +1,18 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { + 'es-roikoren/no-bigint': 'error', + 'es-roikoren/no-dynamic-import': 'error', + 'es-roikoren/no-export-ns-from': 'error', + 'es-roikoren/no-global-this': 'error', + 'es-roikoren/no-import-meta': 'error', + 'es-roikoren/no-nullish-coalescing-operators': 'error', + 'es-roikoren/no-optional-chaining': 'error', + 'es-roikoren/no-promise-all-settled': 'error', + 'es-roikoren/no-string-prototype-matchall': 'error', + }, +}; diff --git a/src/configs/no-new-in-es5.ts b/src/configs/no-new-in-es5.ts new file mode 100644 index 00000000..8ad2a4db --- /dev/null +++ b/src/configs/no-new-in-es5.ts @@ -0,0 +1,37 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { + 'es-roikoren/no-accessor-properties': 'error', + 'es-roikoren/no-array-isarray': 'error', + 'es-roikoren/no-array-prototype-every': 'error', + 'es-roikoren/no-array-prototype-filter': 'error', + 'es-roikoren/no-array-prototype-foreach': 'error', + 'es-roikoren/no-array-prototype-indexof': 'error', + 'es-roikoren/no-array-prototype-lastindexof': 'error', + 'es-roikoren/no-array-prototype-map': 'error', + 'es-roikoren/no-array-prototype-reduce': 'error', + 'es-roikoren/no-array-prototype-reduceright': 'error', + 'es-roikoren/no-array-prototype-some': 'error', + 'es-roikoren/no-date-now': 'error', + 'es-roikoren/no-json': 'error', + 'es-roikoren/no-keyword-properties': 'error', + 'es-roikoren/no-object-defineproperties': 'error', + 'es-roikoren/no-object-defineproperty': 'error', + 'es-roikoren/no-object-freeze': 'error', + 'es-roikoren/no-object-getownpropertydescriptor': 'error', + 'es-roikoren/no-object-getownpropertynames': 'error', + 'es-roikoren/no-object-getprototypeof': 'error', + 'es-roikoren/no-object-isextensible': 'error', + 'es-roikoren/no-object-isfrozen': 'error', + 'es-roikoren/no-object-issealed': 'error', + 'es-roikoren/no-object-keys': 'error', + 'es-roikoren/no-object-preventextensions': 'error', + 'es-roikoren/no-object-seal': 'error', + 'es-roikoren/no-string-prototype-trim': 'error', + 'es-roikoren/no-trailing-commas': 'error', + }, +}; diff --git a/src/configs/no-new-in-esnext.ts b/src/configs/no-new-in-esnext.ts new file mode 100644 index 00000000..df6a9f1a --- /dev/null +++ b/src/configs/no-new-in-esnext.ts @@ -0,0 +1,14 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + plugins: ['es-roikoren'], + rules: { + 'es-roikoren/no-logical-assignment-operators': 'error', + 'es-roikoren/no-numeric-separators': 'error', + 'es-roikoren/no-promise-any': 'error', + 'es-roikoren/no-string-prototype-replaceall': 'error', + 'es-roikoren/no-weakrefs': 'error', + }, +}; diff --git a/src/configs/restrict-to-es2015.ts b/src/configs/restrict-to-es2015.ts new file mode 100644 index 00000000..b6d36ca3 --- /dev/null +++ b/src/configs/restrict-to-es2015.ts @@ -0,0 +1,13 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + extends: [ + require.resolve('./no-new-in-es2020'), + require.resolve('./no-new-in-es2019'), + require.resolve('./no-new-in-es2018'), + require.resolve('./no-new-in-es2017'), + require.resolve('./no-new-in-es2016'), + ], +}; diff --git a/src/configs/restrict-to-es2016.ts b/src/configs/restrict-to-es2016.ts new file mode 100644 index 00000000..417577c7 --- /dev/null +++ b/src/configs/restrict-to-es2016.ts @@ -0,0 +1,12 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + extends: [ + require.resolve('./no-new-in-es2020'), + require.resolve('./no-new-in-es2019'), + require.resolve('./no-new-in-es2018'), + require.resolve('./no-new-in-es2017'), + ], +}; diff --git a/src/configs/restrict-to-es2017.ts b/src/configs/restrict-to-es2017.ts new file mode 100644 index 00000000..1d01c99e --- /dev/null +++ b/src/configs/restrict-to-es2017.ts @@ -0,0 +1,11 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + extends: [ + require.resolve('./no-new-in-es2020'), + require.resolve('./no-new-in-es2019'), + require.resolve('./no-new-in-es2018'), + ], +}; diff --git a/src/configs/restrict-to-es2018.ts b/src/configs/restrict-to-es2018.ts new file mode 100644 index 00000000..942cb10d --- /dev/null +++ b/src/configs/restrict-to-es2018.ts @@ -0,0 +1,5 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { extends: [require.resolve('./no-new-in-es2020'), require.resolve('./no-new-in-es2019')] }; diff --git a/src/configs/restrict-to-es2019.ts b/src/configs/restrict-to-es2019.ts new file mode 100644 index 00000000..0945e346 --- /dev/null +++ b/src/configs/restrict-to-es2019.ts @@ -0,0 +1,5 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { extends: [require.resolve('./no-new-in-es2020')] }; diff --git a/src/configs/restrict-to-es3.ts b/src/configs/restrict-to-es3.ts new file mode 100644 index 00000000..4dbed2f7 --- /dev/null +++ b/src/configs/restrict-to-es3.ts @@ -0,0 +1,15 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + extends: [ + require.resolve('./no-new-in-es2020'), + require.resolve('./no-new-in-es2019'), + require.resolve('./no-new-in-es2018'), + require.resolve('./no-new-in-es2017'), + require.resolve('./no-new-in-es2016'), + require.resolve('./no-new-in-es2015'), + require.resolve('./no-new-in-es5'), + ], +}; diff --git a/src/configs/restrict-to-es5.ts b/src/configs/restrict-to-es5.ts new file mode 100644 index 00000000..ac3ce973 --- /dev/null +++ b/src/configs/restrict-to-es5.ts @@ -0,0 +1,14 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated by 'scripts/update-src-configs.ts' script. + */ +export default { + extends: [ + require.resolve('./no-new-in-es2020'), + require.resolve('./no-new-in-es2019'), + require.resolve('./no-new-in-es2018'), + require.resolve('./no-new-in-es2017'), + require.resolve('./no-new-in-es2016'), + require.resolve('./no-new-in-es2015'), + ], +}; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..76019df0 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,333 @@ +/** + * DON'T EDIT THIS FILE. + * This file was generated automatically by 'scripts/update-src-index.ts'. + */ +import noNewInEs5 from './configs/no-new-in-es5'; +import noNewInEs2015 from './configs/no-new-in-es2015'; +import noNewInEs2016 from './configs/no-new-in-es2016'; +import noNewInEs2017 from './configs/no-new-in-es2017'; +import noNewInEs2018 from './configs/no-new-in-es2018'; +import noNewInEs2019 from './configs/no-new-in-es2019'; +import noNewInEs2020 from './configs/no-new-in-es2020'; +import noNewInEsnext from './configs/no-new-in-esnext'; +import restrictToEs3 from './configs/restrict-to-es3'; +import restrictToEs5 from './configs/restrict-to-es5'; +import restrictToEs2015 from './configs/restrict-to-es2015'; +import restrictToEs2016 from './configs/restrict-to-es2016'; +import restrictToEs2017 from './configs/restrict-to-es2017'; +import restrictToEs2018 from './configs/restrict-to-es2018'; +import restrictToEs2019 from './configs/restrict-to-es2019'; +import noAccessorProperties from './rules/no-accessor-properties'; +import noArrayFrom from './rules/no-array-from'; +import noArrayIsarray from './rules/no-array-isarray'; +import noArrayOf from './rules/no-array-of'; +import noArrayPrototypeCopywithin from './rules/no-array-prototype-copywithin'; +import noArrayPrototypeEntries from './rules/no-array-prototype-entries'; +import noArrayPrototypeEvery from './rules/no-array-prototype-every'; +import noArrayPrototypeFill from './rules/no-array-prototype-fill'; +import noArrayPrototypeFilter from './rules/no-array-prototype-filter'; +import noArrayPrototypeFind from './rules/no-array-prototype-find'; +import noArrayPrototypeFindindex from './rules/no-array-prototype-findindex'; +import noArrayPrototypeFlat from './rules/no-array-prototype-flat'; +import noArrayPrototypeForeach from './rules/no-array-prototype-foreach'; +import noArrayPrototypeIncludes from './rules/no-array-prototype-includes'; +import noArrayPrototypeIndexof from './rules/no-array-prototype-indexof'; +import noArrayPrototypeKeys from './rules/no-array-prototype-keys'; +import noArrayPrototypeLastindexof from './rules/no-array-prototype-lastindexof'; +import noArrayPrototypeMap from './rules/no-array-prototype-map'; +import noArrayPrototypeReduce from './rules/no-array-prototype-reduce'; +import noArrayPrototypeReduceright from './rules/no-array-prototype-reduceright'; +import noArrayPrototypeSome from './rules/no-array-prototype-some'; +import noArrayPrototypeValues from './rules/no-array-prototype-values'; +import noArrowFunctions from './rules/no-arrow-functions'; +import noAsyncFunctions from './rules/no-async-functions'; +import noAsyncIteration from './rules/no-async-iteration'; +import noAtomics from './rules/no-atomics'; +import noBigint from './rules/no-bigint'; +import noBinaryNumericLiterals from './rules/no-binary-numeric-literals'; +import noBlockScopedFunctions from './rules/no-block-scoped-functions'; +import noBlockScopedVariables from './rules/no-block-scoped-variables'; +import noClasses from './rules/no-classes'; +import noComputedProperties from './rules/no-computed-properties'; +import noDateNow from './rules/no-date-now'; +import noDefaultParameters from './rules/no-default-parameters'; +import noDestructuring from './rules/no-destructuring'; +import noDynamicImport from './rules/no-dynamic-import'; +import noExponentialOperators from './rules/no-exponential-operators'; +import noExportNsFrom from './rules/no-export-ns-from'; +import noForOfLoops from './rules/no-for-of-loops'; +import noGenerators from './rules/no-generators'; +import noGlobalThis from './rules/no-global-this'; +import noImportMeta from './rules/no-import-meta'; +import noJson from './rules/no-json'; +import noJsonSuperset from './rules/no-json-superset'; +import noKeywordProperties from './rules/no-keyword-properties'; +import noLogicalAssignmentOperators from './rules/no-logical-assignment-operators'; +import noMalformedTemplateLiterals from './rules/no-malformed-template-literals'; +import noMap from './rules/no-map'; +import noMathAcosh from './rules/no-math-acosh'; +import noMathAsinh from './rules/no-math-asinh'; +import noMathAtanh from './rules/no-math-atanh'; +import noMathCbrt from './rules/no-math-cbrt'; +import noMathClz32 from './rules/no-math-clz32'; +import noMathCosh from './rules/no-math-cosh'; +import noMathExpm1 from './rules/no-math-expm1'; +import noMathFround from './rules/no-math-fround'; +import noMathHypot from './rules/no-math-hypot'; +import noMathImul from './rules/no-math-imul'; +import noMathLog1P from './rules/no-math-log1p'; +import noMathLog2 from './rules/no-math-log2'; +import noMathLog10 from './rules/no-math-log10'; +import noMathSign from './rules/no-math-sign'; +import noMathSinh from './rules/no-math-sinh'; +import noMathTanh from './rules/no-math-tanh'; +import noMathTrunc from './rules/no-math-trunc'; +import noModules from './rules/no-modules'; +import noNewTarget from './rules/no-new-target'; +import noNullishCoalescingOperators from './rules/no-nullish-coalescing-operators'; +import noNumberEpsilon from './rules/no-number-epsilon'; +import noNumberIsfinite from './rules/no-number-isfinite'; +import noNumberIsinteger from './rules/no-number-isinteger'; +import noNumberIsnan from './rules/no-number-isnan'; +import noNumberIssafeinteger from './rules/no-number-issafeinteger'; +import noNumberMaxsafeinteger from './rules/no-number-maxsafeinteger'; +import noNumberMinsafeinteger from './rules/no-number-minsafeinteger'; +import noNumberParsefloat from './rules/no-number-parsefloat'; +import noNumberParseint from './rules/no-number-parseint'; +import noNumericSeparators from './rules/no-numeric-separators'; +import noObjectAssign from './rules/no-object-assign'; +import noObjectDefineproperties from './rules/no-object-defineproperties'; +import noObjectDefineproperty from './rules/no-object-defineproperty'; +import noObjectEntries from './rules/no-object-entries'; +import noObjectFreeze from './rules/no-object-freeze'; +import noObjectFromentries from './rules/no-object-fromentries'; +import noObjectGetownpropertydescriptor from './rules/no-object-getownpropertydescriptor'; +import noObjectGetownpropertydescriptors from './rules/no-object-getownpropertydescriptors'; +import noObjectGetownpropertynames from './rules/no-object-getownpropertynames'; +import noObjectGetownpropertysymbols from './rules/no-object-getownpropertysymbols'; +import noObjectGetprototypeof from './rules/no-object-getprototypeof'; +import noObjectIs from './rules/no-object-is'; +import noObjectIsextensible from './rules/no-object-isextensible'; +import noObjectIsfrozen from './rules/no-object-isfrozen'; +import noObjectIssealed from './rules/no-object-issealed'; +import noObjectKeys from './rules/no-object-keys'; +import noObjectPreventextensions from './rules/no-object-preventextensions'; +import noObjectSeal from './rules/no-object-seal'; +import noObjectSetprototypeof from './rules/no-object-setprototypeof'; +import noObjectSuperProperties from './rules/no-object-super-properties'; +import noObjectValues from './rules/no-object-values'; +import noOctalNumericLiterals from './rules/no-octal-numeric-literals'; +import noOptionalCatchBinding from './rules/no-optional-catch-binding'; +import noOptionalChaining from './rules/no-optional-chaining'; +import noPromise from './rules/no-promise'; +import noPromiseAllSettled from './rules/no-promise-all-settled'; +import noPromiseAny from './rules/no-promise-any'; +import noPromisePrototypeFinally from './rules/no-promise-prototype-finally'; +import noPropertyShorthands from './rules/no-property-shorthands'; +import noProxy from './rules/no-proxy'; +import noReflect from './rules/no-reflect'; +import noRegexpLookbehindAssertions from './rules/no-regexp-lookbehind-assertions'; +import noRegexpNamedCaptureGroups from './rules/no-regexp-named-capture-groups'; +import noRegexpPrototypeFlags from './rules/no-regexp-prototype-flags'; +import noRegexpSFlag from './rules/no-regexp-s-flag'; +import noRegexpUFlag from './rules/no-regexp-u-flag'; +import noRegexpUnicodePropertyEscapes from './rules/no-regexp-unicode-property-escapes'; +import noRegexpUnicodePropertyEscapes2019 from './rules/no-regexp-unicode-property-escapes-2019'; +import noRegexpYFlag from './rules/no-regexp-y-flag'; +import noRestParameters from './rules/no-rest-parameters'; +import noRestSpreadProperties from './rules/no-rest-spread-properties'; +import noSet from './rules/no-set'; +import noSharedArrayBuffer from './rules/no-shared-array-buffer'; +import noSpreadElements from './rules/no-spread-elements'; +import noStringFromcodepoint from './rules/no-string-fromcodepoint'; +import noStringPrototypeCodepointat from './rules/no-string-prototype-codepointat'; +import noStringPrototypeEndswith from './rules/no-string-prototype-endswith'; +import noStringPrototypeIncludes from './rules/no-string-prototype-includes'; +import noStringPrototypeMatchall from './rules/no-string-prototype-matchall'; +import noStringPrototypeNormalize from './rules/no-string-prototype-normalize'; +import noStringPrototypePadstartPadend from './rules/no-string-prototype-padstart-padend'; +import noStringPrototypeRepeat from './rules/no-string-prototype-repeat'; +import noStringPrototypeReplaceall from './rules/no-string-prototype-replaceall'; +import noStringPrototypeStartswith from './rules/no-string-prototype-startswith'; +import noStringPrototypeTrim from './rules/no-string-prototype-trim'; +import noStringPrototypeTrimstartTrimend from './rules/no-string-prototype-trimstart-trimend'; +import noStringRaw from './rules/no-string-raw'; +import noSubclassingBuiltins from './rules/no-subclassing-builtins'; +import noSymbol from './rules/no-symbol'; +import noSymbolPrototypeDescription from './rules/no-symbol-prototype-description'; +import noTemplateLiterals from './rules/no-template-literals'; +import noTrailingCommas from './rules/no-trailing-commas'; +import noTrailingFunctionCommas from './rules/no-trailing-function-commas'; +import noTypedArrays from './rules/no-typed-arrays'; +import noUnicodeCodepointEscapes from './rules/no-unicode-codepoint-escapes'; +import noWeakMap from './rules/no-weak-map'; +import noWeakSet from './rules/no-weak-set'; +import noWeakrefs from './rules/no-weakrefs'; + +export default { + configs: { + 'no-new-in-es5': noNewInEs5, + 'no-new-in-es2015': noNewInEs2015, + 'no-new-in-es2016': noNewInEs2016, + 'no-new-in-es2017': noNewInEs2017, + 'no-new-in-es2018': noNewInEs2018, + 'no-new-in-es2019': noNewInEs2019, + 'no-new-in-es2020': noNewInEs2020, + 'no-new-in-esnext': noNewInEsnext, + 'restrict-to-es3': restrictToEs3, + 'restrict-to-es5': restrictToEs5, + 'restrict-to-es2015': restrictToEs2015, + 'restrict-to-es2016': restrictToEs2016, + 'restrict-to-es2017': restrictToEs2017, + 'restrict-to-es2018': restrictToEs2018, + 'restrict-to-es2019': restrictToEs2019, + }, + rules: { + 'no-accessor-properties': noAccessorProperties, + 'no-array-from': noArrayFrom, + 'no-array-isarray': noArrayIsarray, + 'no-array-of': noArrayOf, + 'no-array-prototype-copywithin': noArrayPrototypeCopywithin, + 'no-array-prototype-entries': noArrayPrototypeEntries, + 'no-array-prototype-every': noArrayPrototypeEvery, + 'no-array-prototype-fill': noArrayPrototypeFill, + 'no-array-prototype-filter': noArrayPrototypeFilter, + 'no-array-prototype-find': noArrayPrototypeFind, + 'no-array-prototype-findindex': noArrayPrototypeFindindex, + 'no-array-prototype-flat': noArrayPrototypeFlat, + 'no-array-prototype-foreach': noArrayPrototypeForeach, + 'no-array-prototype-includes': noArrayPrototypeIncludes, + 'no-array-prototype-indexof': noArrayPrototypeIndexof, + 'no-array-prototype-keys': noArrayPrototypeKeys, + 'no-array-prototype-lastindexof': noArrayPrototypeLastindexof, + 'no-array-prototype-map': noArrayPrototypeMap, + 'no-array-prototype-reduce': noArrayPrototypeReduce, + 'no-array-prototype-reduceright': noArrayPrototypeReduceright, + 'no-array-prototype-some': noArrayPrototypeSome, + 'no-array-prototype-values': noArrayPrototypeValues, + 'no-arrow-functions': noArrowFunctions, + 'no-async-functions': noAsyncFunctions, + 'no-async-iteration': noAsyncIteration, + 'no-atomics': noAtomics, + 'no-bigint': noBigint, + 'no-binary-numeric-literals': noBinaryNumericLiterals, + 'no-block-scoped-functions': noBlockScopedFunctions, + 'no-block-scoped-variables': noBlockScopedVariables, + 'no-classes': noClasses, + 'no-computed-properties': noComputedProperties, + 'no-date-now': noDateNow, + 'no-default-parameters': noDefaultParameters, + 'no-destructuring': noDestructuring, + 'no-dynamic-import': noDynamicImport, + 'no-exponential-operators': noExponentialOperators, + 'no-export-ns-from': noExportNsFrom, + 'no-for-of-loops': noForOfLoops, + 'no-generators': noGenerators, + 'no-global-this': noGlobalThis, + 'no-import-meta': noImportMeta, + 'no-json': noJson, + 'no-json-superset': noJsonSuperset, + 'no-keyword-properties': noKeywordProperties, + 'no-logical-assignment-operators': noLogicalAssignmentOperators, + 'no-malformed-template-literals': noMalformedTemplateLiterals, + 'no-map': noMap, + 'no-math-acosh': noMathAcosh, + 'no-math-asinh': noMathAsinh, + 'no-math-atanh': noMathAtanh, + 'no-math-cbrt': noMathCbrt, + 'no-math-clz32': noMathClz32, + 'no-math-cosh': noMathCosh, + 'no-math-expm1': noMathExpm1, + 'no-math-fround': noMathFround, + 'no-math-hypot': noMathHypot, + 'no-math-imul': noMathImul, + 'no-math-log1p': noMathLog1P, + 'no-math-log2': noMathLog2, + 'no-math-log10': noMathLog10, + 'no-math-sign': noMathSign, + 'no-math-sinh': noMathSinh, + 'no-math-tanh': noMathTanh, + 'no-math-trunc': noMathTrunc, + 'no-modules': noModules, + 'no-new-target': noNewTarget, + 'no-nullish-coalescing-operators': noNullishCoalescingOperators, + 'no-number-epsilon': noNumberEpsilon, + 'no-number-isfinite': noNumberIsfinite, + 'no-number-isinteger': noNumberIsinteger, + 'no-number-isnan': noNumberIsnan, + 'no-number-issafeinteger': noNumberIssafeinteger, + 'no-number-maxsafeinteger': noNumberMaxsafeinteger, + 'no-number-minsafeinteger': noNumberMinsafeinteger, + 'no-number-parsefloat': noNumberParsefloat, + 'no-number-parseint': noNumberParseint, + 'no-numeric-separators': noNumericSeparators, + 'no-object-assign': noObjectAssign, + 'no-object-defineproperties': noObjectDefineproperties, + 'no-object-defineproperty': noObjectDefineproperty, + 'no-object-entries': noObjectEntries, + 'no-object-freeze': noObjectFreeze, + 'no-object-fromentries': noObjectFromentries, + 'no-object-getownpropertydescriptor': noObjectGetownpropertydescriptor, + 'no-object-getownpropertydescriptors': noObjectGetownpropertydescriptors, + 'no-object-getownpropertynames': noObjectGetownpropertynames, + 'no-object-getownpropertysymbols': noObjectGetownpropertysymbols, + 'no-object-getprototypeof': noObjectGetprototypeof, + 'no-object-is': noObjectIs, + 'no-object-isextensible': noObjectIsextensible, + 'no-object-isfrozen': noObjectIsfrozen, + 'no-object-issealed': noObjectIssealed, + 'no-object-keys': noObjectKeys, + 'no-object-preventextensions': noObjectPreventextensions, + 'no-object-seal': noObjectSeal, + 'no-object-setprototypeof': noObjectSetprototypeof, + 'no-object-super-properties': noObjectSuperProperties, + 'no-object-values': noObjectValues, + 'no-octal-numeric-literals': noOctalNumericLiterals, + 'no-optional-catch-binding': noOptionalCatchBinding, + 'no-optional-chaining': noOptionalChaining, + 'no-promise': noPromise, + 'no-promise-all-settled': noPromiseAllSettled, + 'no-promise-any': noPromiseAny, + 'no-promise-prototype-finally': noPromisePrototypeFinally, + 'no-property-shorthands': noPropertyShorthands, + 'no-proxy': noProxy, + 'no-reflect': noReflect, + 'no-regexp-lookbehind-assertions': noRegexpLookbehindAssertions, + 'no-regexp-named-capture-groups': noRegexpNamedCaptureGroups, + 'no-regexp-prototype-flags': noRegexpPrototypeFlags, + 'no-regexp-s-flag': noRegexpSFlag, + 'no-regexp-u-flag': noRegexpUFlag, + 'no-regexp-unicode-property-escapes': noRegexpUnicodePropertyEscapes, + 'no-regexp-unicode-property-escapes-2019': noRegexpUnicodePropertyEscapes2019, + 'no-regexp-y-flag': noRegexpYFlag, + 'no-rest-parameters': noRestParameters, + 'no-rest-spread-properties': noRestSpreadProperties, + 'no-set': noSet, + 'no-shared-array-buffer': noSharedArrayBuffer, + 'no-spread-elements': noSpreadElements, + 'no-string-fromcodepoint': noStringFromcodepoint, + 'no-string-prototype-codepointat': noStringPrototypeCodepointat, + 'no-string-prototype-endswith': noStringPrototypeEndswith, + 'no-string-prototype-includes': noStringPrototypeIncludes, + 'no-string-prototype-matchall': noStringPrototypeMatchall, + 'no-string-prototype-normalize': noStringPrototypeNormalize, + 'no-string-prototype-padstart-padend': noStringPrototypePadstartPadend, + 'no-string-prototype-repeat': noStringPrototypeRepeat, + 'no-string-prototype-replaceall': noStringPrototypeReplaceall, + 'no-string-prototype-startswith': noStringPrototypeStartswith, + 'no-string-prototype-trim': noStringPrototypeTrim, + 'no-string-prototype-trimstart-trimend': noStringPrototypeTrimstartTrimend, + 'no-string-raw': noStringRaw, + 'no-subclassing-builtins': noSubclassingBuiltins, + 'no-symbol': noSymbol, + 'no-symbol-prototype-description': noSymbolPrototypeDescription, + 'no-template-literals': noTemplateLiterals, + 'no-trailing-commas': noTrailingCommas, + 'no-trailing-function-commas': noTrailingFunctionCommas, + 'no-typed-arrays': noTypedArrays, + 'no-unicode-codepoint-escapes': noUnicodeCodepointEscapes, + 'no-weak-map': noWeakMap, + 'no-weak-set': noWeakSet, + 'no-weakrefs': noWeakrefs, + }, +}; diff --git a/src/rules/no-accessor-properties.ts b/src/rules/no-accessor-properties.ts new file mode 100644 index 00000000..e607a1b9 --- /dev/null +++ b/src/rules/no-accessor-properties.ts @@ -0,0 +1,24 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-accessor-properties', + meta: { + type: 'problem', + docs: { description: 'disallow accessor properties.', recommended: false }, + schema: [], + messages: { forbidden: 'ES5 accessor properties are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + "Property[kind='get'], Property[kind='set'], MethodDefinition[kind='get'], MethodDefinition[kind='set']"( + node: TSESTree.MethodDefinition | TSESTree.Property, + ) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-array-from.ts b/src/rules/no-array-from.ts new file mode 100644 index 00000000..ec3d2058 --- /dev/null +++ b/src/rules/no-array-from.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-array-from', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.from` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Array: { from: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-array-isarray.ts b/src/rules/no-array-isarray.ts new file mode 100644 index 00000000..2a251f76 --- /dev/null +++ b/src/rules/no-array-isarray.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-array-isarray', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.isArray` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Array: { isArray: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-array-of.ts b/src/rules/no-array-of.ts new file mode 100644 index 00000000..3cf82168 --- /dev/null +++ b/src/rules/no-array-of.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-array-of', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.of` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Array: { of: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-array-prototype-copywithin.ts b/src/rules/no-array-prototype-copywithin.ts new file mode 100644 index 00000000..16541945 --- /dev/null +++ b/src/rules/no-array-prototype-copywithin.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-copywithin', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.copyWithin` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['copyWithin'] }); + }, +}); diff --git a/src/rules/no-array-prototype-entries.ts b/src/rules/no-array-prototype-entries.ts new file mode 100644 index 00000000..4e972178 --- /dev/null +++ b/src/rules/no-array-prototype-entries.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-entries', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.entries` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['entries'] }); + }, +}); diff --git a/src/rules/no-array-prototype-every.ts b/src/rules/no-array-prototype-every.ts new file mode 100644 index 00000000..a8f47e22 --- /dev/null +++ b/src/rules/no-array-prototype-every.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-every', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.every` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['every'] }); + }, +}); diff --git a/src/rules/no-array-prototype-fill.ts b/src/rules/no-array-prototype-fill.ts new file mode 100644 index 00000000..f059c91e --- /dev/null +++ b/src/rules/no-array-prototype-fill.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-fill', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.fill` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['fill'] }); + }, +}); diff --git a/src/rules/no-array-prototype-filter.ts b/src/rules/no-array-prototype-filter.ts new file mode 100644 index 00000000..f32f9d6a --- /dev/null +++ b/src/rules/no-array-prototype-filter.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-filter', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.filter` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['filter'] }); + }, +}); diff --git a/src/rules/no-array-prototype-find.ts b/src/rules/no-array-prototype-find.ts new file mode 100644 index 00000000..5e04648f --- /dev/null +++ b/src/rules/no-array-prototype-find.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-find', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.find` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['find'] }); + }, +}); diff --git a/src/rules/no-array-prototype-findindex.ts b/src/rules/no-array-prototype-findindex.ts new file mode 100644 index 00000000..b1902235 --- /dev/null +++ b/src/rules/no-array-prototype-findindex.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-findindex', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.findIndex` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['findIndex'] }); + }, +}); diff --git a/src/rules/no-array-prototype-flat.ts b/src/rules/no-array-prototype-flat.ts new file mode 100644 index 00000000..01597800 --- /dev/null +++ b/src/rules/no-array-prototype-flat.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2019'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-flat', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.{flat,flatMap}` method.', recommended: false }, + schema, + messages: { forbidden: "ES2019 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['flat', 'flatMap'] }); + }, +}); diff --git a/src/rules/no-array-prototype-foreach.ts b/src/rules/no-array-prototype-foreach.ts new file mode 100644 index 00000000..063fd2ad --- /dev/null +++ b/src/rules/no-array-prototype-foreach.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-foreach', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.forEach` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['forEach'] }); + }, +}); diff --git a/src/rules/no-array-prototype-includes.ts b/src/rules/no-array-prototype-includes.ts new file mode 100644 index 00000000..145a044f --- /dev/null +++ b/src/rules/no-array-prototype-includes.ts @@ -0,0 +1,31 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2016'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-includes', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.includes` method.', recommended: false }, + schema, + messages: { forbidden: "ES2016 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { + Array: ['includes'], + Int8Array: ['includes'], + Uint8Array: ['includes'], + Uint8ClampedArray: ['includes'], + Int16Array: ['includes'], + Uint16Array: ['includes'], + Int32Array: ['includes'], + Uint32Array: ['includes'], + Float32Array: ['includes'], + Float64Array: ['includes'], + BigInt64Array: ['includes'], + BigUint64Array: ['includes'], + }); + }, +}); diff --git a/src/rules/no-array-prototype-indexof.ts b/src/rules/no-array-prototype-indexof.ts new file mode 100644 index 00000000..d2a0a764 --- /dev/null +++ b/src/rules/no-array-prototype-indexof.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-indexof', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.indexOf` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['indexOf'] }); + }, +}); diff --git a/src/rules/no-array-prototype-keys.ts b/src/rules/no-array-prototype-keys.ts new file mode 100644 index 00000000..44a08ba7 --- /dev/null +++ b/src/rules/no-array-prototype-keys.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-keys', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.keys` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['keys'] }); + }, +}); diff --git a/src/rules/no-array-prototype-lastindexof.ts b/src/rules/no-array-prototype-lastindexof.ts new file mode 100644 index 00000000..47c0e84c --- /dev/null +++ b/src/rules/no-array-prototype-lastindexof.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-lastindexof', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.lastIndexOf` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { + Array: ['lastIndexOf'], + }); + }, +}); diff --git a/src/rules/no-array-prototype-map.ts b/src/rules/no-array-prototype-map.ts new file mode 100644 index 00000000..30d47f44 --- /dev/null +++ b/src/rules/no-array-prototype-map.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-map', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.map` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['map'] }); + }, +}); diff --git a/src/rules/no-array-prototype-reduce.ts b/src/rules/no-array-prototype-reduce.ts new file mode 100644 index 00000000..06f8fa0b --- /dev/null +++ b/src/rules/no-array-prototype-reduce.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-reduce', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.reduce` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['reduce'] }); + }, +}); diff --git a/src/rules/no-array-prototype-reduceright.ts b/src/rules/no-array-prototype-reduceright.ts new file mode 100644 index 00000000..1d132dbd --- /dev/null +++ b/src/rules/no-array-prototype-reduceright.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-reduceright', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.reduceRight` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['reduceRight'] }); + }, +}); diff --git a/src/rules/no-array-prototype-some.ts b/src/rules/no-array-prototype-some.ts new file mode 100644 index 00000000..37003618 --- /dev/null +++ b/src/rules/no-array-prototype-some.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-some', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.some` method.', recommended: false }, + schema, + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['some'] }); + }, +}); diff --git a/src/rules/no-array-prototype-values.ts b/src/rules/no-array-prototype-values.ts new file mode 100644 index 00000000..83af7b78 --- /dev/null +++ b/src/rules/no-array-prototype-values.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-array-prototype-values', + meta: { + type: 'problem', + docs: { description: 'disallow the `Array.prototype.values` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Array: ['values'] }); + }, +}); diff --git a/src/rules/no-arrow-functions.ts b/src/rules/no-arrow-functions.ts new file mode 100644 index 00000000..c6091399 --- /dev/null +++ b/src/rules/no-arrow-functions.ts @@ -0,0 +1,110 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +interface IStack { + upper: IStack | null; + hasThis: boolean; + hasSuper: boolean; +} + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-arrow-functions', + meta: { + type: 'problem', + docs: { description: 'disallow arrow function expressions.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: 'ES2015 arrow function expressions are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * ArrowFunctionExpression to FunctionExpression + * @param {Node} node ArrowFunctionExpression Node + * @param {boolean} hasThis `true` if the function has `this`. + * @returns {string} function expression text + */ + const toFunctionExpression = (node: TSESTree.ArrowFunctionExpression, hasThis: boolean): string => { + const { params, body, range, async, parent } = node; + const paramText = + params.length > 0 ? sourceCode.text.slice(params[0].range[0], params[params.length - 1].range[1]) : ''; + + const arrowToken = sourceCode.getTokenBefore(body, ASTUtils.isArrowToken); + const preText = sourceCode.text.slice(arrowToken?.range[1], body.range[0]); + const bodyText = sourceCode.text.slice(arrowToken?.range[1], range[1]).trim(); + let resultText = `function(${paramText}) ${bodyText}`; + + if (body.type !== 'BlockStatement') { + resultText = preText.includes('\n') + ? `function(${paramText}) { return (${bodyText}) }` + : `function(${paramText}) { return ${bodyText} }`; + } + + if (async) { + resultText = `async ${resultText}`; + } + + if (hasThis) { + resultText += '.bind(this)'; + } + + if (parent?.type === 'ExpressionStatement' && !ASTUtils.isParenthesized(node, sourceCode)) { + resultText = `(${resultText})`; + } + + return resultText; + }; + + /** + * Report that ArrowFunctionExpression is being used + * @param {Node} node ArrowFunctionExpression Node + * @param {boolean} hasThis Whether `this` is referenced in` function` scope + * @param {boolean} hasSuper Whether `super` is referenced in` function` scope + * @returns {void} + */ + const report = (node: TSESTree.ArrowFunctionExpression, hasThis: boolean, hasSuper: boolean): void => { + context.report({ + node, + messageId: 'forbidden', + fix(fixer) { + if (hasSuper) { + return null; + } + + return fixer.replaceText(node, toFunctionExpression(node, hasThis)); + }, + }); + }; + + let stack: IStack = { upper: null, hasThis: false, hasSuper: false }; + + return { + ':function'() { + stack = { upper: stack, hasThis: false, hasSuper: false }; + }, + ':function:exit'(node: TSESTree.Node) { + const { hasThis, hasSuper, upper } = stack; + + stack = upper as IStack; + + if (node.type === 'ArrowFunctionExpression') { + report(node, hasThis, hasSuper); + + stack.hasThis ||= hasThis; + stack.hasSuper ||= hasSuper; + } + }, + ThisExpression() { + stack.hasThis = true; + }, + Super() { + stack.hasSuper = true; + }, + }; + }, +}); diff --git a/src/rules/no-async-functions.ts b/src/rules/no-async-functions.ts new file mode 100644 index 00000000..d02ef230 --- /dev/null +++ b/src/rules/no-async-functions.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2017'; +export default createRule<[], 'forbidden'>({ + name: 'no-async-functions', + meta: { + type: 'problem', + docs: { description: 'disallow async function declarations.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2017 async function declarations are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':function[async=true]'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-async-iteration.ts b/src/rules/no-async-iteration.ts new file mode 100644 index 00000000..5f6f0b6b --- /dev/null +++ b/src/rules/no-async-iteration.ts @@ -0,0 +1,23 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2018'; +export default createRule<[], 'forbidden'>({ + name: 'no-async-iteration', + meta: { + type: 'problem', + docs: { description: 'disallow async iteration.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2018 async iteration is forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':function[async=true][generator=true]'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + 'ForOfStatement[await=true]'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-atomics.ts b/src/rules/no-atomics.ts new file mode 100644 index 00000000..e5686b0b --- /dev/null +++ b/src/rules/no-atomics.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2017'; +export default createRule<[], 'forbidden'>({ + name: 'no-atomics', + meta: { + type: 'problem', + docs: { description: 'disallow the `Atomics` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2017 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Atomics: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-bigint.ts b/src/rules/no-bigint.ts new file mode 100644 index 00000000..96298b7f --- /dev/null +++ b/src/rules/no-bigint.ts @@ -0,0 +1,31 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-bigint', + meta: { + type: 'problem', + docs: { description: 'disallow `bigint` syntax and built-ins.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2020 BigInt is forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + Literal(node) { + if ((node as TSESTree.BigIntLiteral).bigint && (node as TSESTree.BigIntLiteral).bigint !== '') { + context.report({ messageId: 'forbidden', node }); + } + }, + ...referenceTracker(context, { + BigInt: { [ASTUtils.ReferenceTracker.READ]: true }, + BigInt64Array: { [ASTUtils.ReferenceTracker.READ]: true }, + BigUint64Array: { [ASTUtils.ReferenceTracker.READ]: true }, + }), + }; + }, +}); diff --git a/src/rules/no-binary-numeric-literals.ts b/src/rules/no-binary-numeric-literals.ts new file mode 100644 index 00000000..d5627659 --- /dev/null +++ b/src/rules/no-binary-numeric-literals.ts @@ -0,0 +1,24 @@ +import { createRule } from '../util/create-rule'; + +const Pattern = /^0[bB]/u; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-binary-numeric-literals', + meta: { + type: 'problem', + docs: { description: 'disallow binary numeric literals.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 binary numeric literals are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + Literal(node) { + if (typeof node.value === 'number' && Pattern.test(node.raw)) { + context.report({ node, messageId: 'forbidden' }); + } + }, + }; + }, +}); diff --git a/src/rules/no-block-scoped-functions.ts b/src/rules/no-block-scoped-functions.ts new file mode 100644 index 00000000..7bdcd28c --- /dev/null +++ b/src/rules/no-block-scoped-functions.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-block-scoped-functions', + meta: { + type: 'problem', + docs: { description: 'disallow block-scoped function declarations.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 block-scoped functions are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':not(:function) > BlockStatement > FunctionDeclaration'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-block-scoped-variables.ts b/src/rules/no-block-scoped-variables.ts new file mode 100644 index 00000000..0fb302ba --- /dev/null +++ b/src/rules/no-block-scoped-variables.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-block-scoped-variables', + meta: { + type: 'problem', + docs: { description: 'disallow block-scoped variable declarations.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 block-scoped variables are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + "VariableDeclaration[kind='const'], VariableDeclaration[kind='let']"(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-classes.ts b/src/rules/no-classes.ts new file mode 100644 index 00000000..c15f3039 --- /dev/null +++ b/src/rules/no-classes.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-classes', + meta: { + type: 'problem', + docs: { description: 'disallow class declarations.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 class declarations are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + 'ClassDeclaration, ClassExpression'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-computed-properties.ts b/src/rules/no-computed-properties.ts new file mode 100644 index 00000000..01547fdc --- /dev/null +++ b/src/rules/no-computed-properties.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-computed-properties', + meta: { + type: 'problem', + docs: { description: 'disallow computed properties.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 computed properties are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':matches(Property, MethodDefinition)[computed=true]'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-date-now.ts b/src/rules/no-date-now.ts new file mode 100644 index 00000000..ab4c8d5a --- /dev/null +++ b/src/rules/no-date-now.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-date-now', + meta: { + type: 'problem', + docs: { description: 'disallow the `Date.now` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Date: { now: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-default-parameters.ts b/src/rules/no-default-parameters.ts new file mode 100644 index 00000000..60a3ff3a --- /dev/null +++ b/src/rules/no-default-parameters.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-default-parameters', + meta: { + type: 'problem', + docs: { description: 'disallow default parameters.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 default parameters are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':function > AssignmentPattern'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-destructuring.ts b/src/rules/no-destructuring.ts new file mode 100644 index 00000000..1e950cf6 --- /dev/null +++ b/src/rules/no-destructuring.ts @@ -0,0 +1,22 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-destructuring', + meta: { + type: 'problem', + docs: { description: 'disallow destructuring.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 destructuring is forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':matches(:function, AssignmentExpression, VariableDeclarator, :function > :matches(AssignmentPattern, RestElement), ForInStatement, ForOfStatement) > :matches(ArrayPattern, ObjectPattern)'( + node, + ) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-dynamic-import.ts b/src/rules/no-dynamic-import.ts new file mode 100644 index 00000000..0d9ff38f --- /dev/null +++ b/src/rules/no-dynamic-import.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-dynamic-import', + meta: { + type: 'problem', + docs: { description: 'disallow `import()` syntax.', recommended: false }, + schema: [], + messages: { forbidden: "ES2020 'import()' syntax is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + ImportExpression(node) { + context.report({ messageId: 'forbidden', node }); + }, + }; + }, +}); diff --git a/src/rules/no-exponential-operators.ts b/src/rules/no-exponential-operators.ts new file mode 100644 index 00000000..57978c58 --- /dev/null +++ b/src/rules/no-exponential-operators.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2016'; +export default createRule<[], 'forbidden'>({ + name: 'no-exponential-operators', + meta: { + type: 'problem', + docs: { description: 'disallow exponential operators.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2016 exponential operators are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + "AssignmentExpression[operator='**='], BinaryExpression[operator='**']"(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-export-ns-from.ts b/src/rules/no-export-ns-from.ts new file mode 100644 index 00000000..ba3cc906 --- /dev/null +++ b/src/rules/no-export-ns-from.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-export-ns-from', + meta: { + type: 'problem', + docs: { description: 'disallow `export * as ns`.', recommended: false }, + schema: [], + messages: { forbidden: "ES2020 'export * as ns' are forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + 'ExportAllDeclaration[exported!=null]'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-for-of-loops.ts b/src/rules/no-for-of-loops.ts new file mode 100644 index 00000000..06765bb4 --- /dev/null +++ b/src/rules/no-for-of-loops.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-for-of-loops', + meta: { + type: 'problem', + docs: { description: 'disallow `for-of` statements.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 'for-of' statements are forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + ForOfStatement(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-generators.ts b/src/rules/no-generators.ts new file mode 100644 index 00000000..33e3004d --- /dev/null +++ b/src/rules/no-generators.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-generators', + meta: { + type: 'problem', + docs: { description: 'disallow generator function declarations.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 generator function declarations are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':function[generator=true]'(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-global-this.ts b/src/rules/no-global-this.ts new file mode 100644 index 00000000..a8c97538 --- /dev/null +++ b/src/rules/no-global-this.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-global-this', + meta: { + type: 'problem', + docs: { description: 'disallow the `globalThis` variable.', recommended: false }, + schema: [], + messages: { forbidden: "ES2020 '{{name}}' variable is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { globalThis: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-import-meta.ts b/src/rules/no-import-meta.ts new file mode 100644 index 00000000..0099e979 --- /dev/null +++ b/src/rules/no-import-meta.ts @@ -0,0 +1,20 @@ +import { createRule } from '../util/create-rule'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-import-meta', + meta: { + type: 'problem', + docs: { description: 'disallow `import.meta` meta property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2020 'import.meta' meta property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + "MetaProperty[meta.name='import'][property.name='meta']"(node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-json-superset.ts b/src/rules/no-json-superset.ts new file mode 100644 index 00000000..d1ffb4db --- /dev/null +++ b/src/rules/no-json-superset.ts @@ -0,0 +1,43 @@ +import { createRule } from '../util/create-rule'; +import { definePatternSearchGenerator } from '../util/define-pattern-search-generator'; + +const iterateTargetChars = definePatternSearchGenerator(/[\u2028\u2029]/gu); + +export const category = 'ES2019'; +export default createRule<[], 'forbidden'>({ + name: 'no-json-superset', + meta: { + type: 'problem', + docs: { description: 'disallow `\\u2028` and `\\u2029` in string literals.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: "ES2019 '\\u{{code}}' in string literals is forbidden." }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + return { + Literal(node) { + if (typeof node.value !== 'string') { + return; + } + + const [offset] = node.range; + + for (const { index } of iterateTargetChars(node.raw)) { + const code = node.raw.codePointAt(index)?.toString(16); + const loc = sourceCode.getLocFromIndex(offset + index); + + context.report({ + node, + loc, + messageId: 'forbidden', + data: { code }, + fix: (fixer) => fixer.replaceTextRange([offset + index, offset + index + 1], `\\u${code as string}`), + }); + } + }, + }; + }, +}); diff --git a/src/rules/no-json.ts b/src/rules/no-json.ts new file mode 100644 index 00000000..9b7eff1e --- /dev/null +++ b/src/rules/no-json.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-json', + meta: { + type: 'problem', + docs: { description: 'disallow the `JSON` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { JSON: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-keyword-properties.ts b/src/rules/no-keyword-properties.ts new file mode 100644 index 00000000..8bec18dc --- /dev/null +++ b/src/rules/no-keyword-properties.ts @@ -0,0 +1,90 @@ +import { createRule } from '../util/create-rule'; + +// https://www-archive.mozilla.org/js/language/E262-3.pdf +const keywords = new Set([ + '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', +]); + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-keyword-properties', + meta: { + type: 'problem', + docs: { description: 'disallow reserved words as property names.', recommended: false }, + schema: [], + messages: { forbidden: 'ES5 reserved words as property names are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + Property(node) { + if (!node.computed && node.key.type === 'Identifier' && keywords.has(node.key.name)) { + context.report({ node, messageId: 'forbidden' }); + } + }, + MemberExpression(node) { + if (!node.computed && node.property.type === 'Identifier' && keywords.has(node.property.name)) { + context.report({ node, messageId: 'forbidden' }); + } + }, + }; + }, +}); diff --git a/src/rules/no-logical-assignment-operators.ts b/src/rules/no-logical-assignment-operators.ts new file mode 100644 index 00000000..76b7330c --- /dev/null +++ b/src/rules/no-logical-assignment-operators.ts @@ -0,0 +1,51 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2021'; +export default createRule<[], 'forbidden'>({ + name: 'no-logical-assignment-operators', + meta: { + type: 'problem', + docs: { description: 'disallow logical assignment operators.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: 'ES2021 logical assignment operators are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + return { + 'AssignmentExpression[operator=/(?:\\|\\||&&|\\?\\?)=/]'(node: TSESTree.AssignmentExpression) { + const operatorToken = sourceCode.getTokenAfter(node.left) as TSESTree.Token; + + context.report({ + node: operatorToken, + messageId: 'forbidden', + fix(fixer) { + if (node.left.type !== 'Identifier') { + return null; + } + + const newOperator = node.operator.slice(-1); + const biOperator = node.operator.slice(0, -1); + const varText = sourceCode.getText(node.left); + + const results = [ + fixer.replaceText(operatorToken, newOperator), + fixer.insertTextAfter(operatorToken, ` ${varText} ${biOperator}`), + ]; + + if (!ASTUtils.isParenthesized(node.right, sourceCode)) { + results.push(fixer.insertTextBefore(node.right, '('), fixer.insertTextAfter(node.right, ')')); + } + + return results; + }, + }); + }, + }; + }, +}); diff --git a/src/rules/no-malformed-template-literals.ts b/src/rules/no-malformed-template-literals.ts new file mode 100644 index 00000000..9c1053fb --- /dev/null +++ b/src/rules/no-malformed-template-literals.ts @@ -0,0 +1,29 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2018'; +export default createRule<[], 'forbidden'>({ + name: 'no-malformed-template-literals', + meta: { + type: 'problem', + docs: { description: 'disallow template literals with invalid escape sequences.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2018 template literals with invalid escape sequences are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const reported = new Set(); + + return { + 'TemplateElement[value.cooked=null]'(elementNode: TSESTree.TemplateElement) { + const node = elementNode.parent as TSESTree.Node; + + if (!reported.has(node)) { + reported.add(node); + context.report({ node, messageId: 'forbidden' }); + } + }, + }; + }, +}); diff --git a/src/rules/no-map.ts b/src/rules/no-map.ts new file mode 100644 index 00000000..0638cb22 --- /dev/null +++ b/src/rules/no-map.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-map', + meta: { + type: 'problem', + docs: { description: 'disallow the `Map` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Map: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-math-acosh.ts b/src/rules/no-math-acosh.ts new file mode 100644 index 00000000..4b35a378 --- /dev/null +++ b/src/rules/no-math-acosh.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-acosh', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.acosh` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { acosh: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-asinh.ts b/src/rules/no-math-asinh.ts new file mode 100644 index 00000000..1ed7fcdf --- /dev/null +++ b/src/rules/no-math-asinh.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-asinh', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.asinh` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { asinh: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-atanh.ts b/src/rules/no-math-atanh.ts new file mode 100644 index 00000000..80330bc1 --- /dev/null +++ b/src/rules/no-math-atanh.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-atanh', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.atanh` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { atanh: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-cbrt.ts b/src/rules/no-math-cbrt.ts new file mode 100644 index 00000000..a2cebc7a --- /dev/null +++ b/src/rules/no-math-cbrt.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-cbrt', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.cbrt` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { cbrt: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-clz32.ts b/src/rules/no-math-clz32.ts new file mode 100644 index 00000000..1c69efd3 --- /dev/null +++ b/src/rules/no-math-clz32.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-clz32', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.clz32` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { clz32: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-cosh.ts b/src/rules/no-math-cosh.ts new file mode 100644 index 00000000..0f7e002f --- /dev/null +++ b/src/rules/no-math-cosh.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-cosh', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.cosh` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { cosh: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-expm1.ts b/src/rules/no-math-expm1.ts new file mode 100644 index 00000000..9af8d7b8 --- /dev/null +++ b/src/rules/no-math-expm1.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-expm1', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.expm1` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { expm1: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-fround.ts b/src/rules/no-math-fround.ts new file mode 100644 index 00000000..5125b23e --- /dev/null +++ b/src/rules/no-math-fround.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-fround', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.fround` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { fround: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-hypot.ts b/src/rules/no-math-hypot.ts new file mode 100644 index 00000000..665cde06 --- /dev/null +++ b/src/rules/no-math-hypot.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-hypot', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.hypot` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { hypot: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-imul.ts b/src/rules/no-math-imul.ts new file mode 100644 index 00000000..7b0a1a37 --- /dev/null +++ b/src/rules/no-math-imul.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-imul', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.imul` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { imul: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-log10.ts b/src/rules/no-math-log10.ts new file mode 100644 index 00000000..83c6f15f --- /dev/null +++ b/src/rules/no-math-log10.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-log10', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.log10` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { log10: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-log1p.ts b/src/rules/no-math-log1p.ts new file mode 100644 index 00000000..19a6c608 --- /dev/null +++ b/src/rules/no-math-log1p.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-log1p', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.log1p` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { log1p: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-log2.ts b/src/rules/no-math-log2.ts new file mode 100644 index 00000000..8b40ce94 --- /dev/null +++ b/src/rules/no-math-log2.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-log2', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.log2` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { log2: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-sign.ts b/src/rules/no-math-sign.ts new file mode 100644 index 00000000..e2b551e9 --- /dev/null +++ b/src/rules/no-math-sign.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-sign', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.sign` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { sign: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-sinh.ts b/src/rules/no-math-sinh.ts new file mode 100644 index 00000000..966d9b8d --- /dev/null +++ b/src/rules/no-math-sinh.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-sinh', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.sinh` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { sinh: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-tanh.ts b/src/rules/no-math-tanh.ts new file mode 100644 index 00000000..9ef314be --- /dev/null +++ b/src/rules/no-math-tanh.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-tanh', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.tanh` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { tanh: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-math-trunc.ts b/src/rules/no-math-trunc.ts new file mode 100644 index 00000000..43b04426 --- /dev/null +++ b/src/rules/no-math-trunc.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-math-trunc', + meta: { + type: 'problem', + docs: { description: 'disallow the `Math.trunc` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Math: { trunc: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-modules.ts b/src/rules/no-modules.ts new file mode 100644 index 00000000..206d220a --- /dev/null +++ b/src/rules/no-modules.ts @@ -0,0 +1,22 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-modules', + meta: { + type: 'problem', + docs: { description: 'disallow modules.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 modules are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + 'ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, ImportDeclaration'(node: TSESTree.Node) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-new-target.ts b/src/rules/no-new-target.ts new file mode 100644 index 00000000..606641b0 --- /dev/null +++ b/src/rules/no-new-target.ts @@ -0,0 +1,22 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-new-target', + meta: { + type: 'problem', + docs: { description: 'disallow `new.target` meta property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 'new.target' meta property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + "MetaProperty[meta.name='new'][property.name='target']"(node: TSESTree.MetaProperty) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-nullish-coalescing-operators.ts b/src/rules/no-nullish-coalescing-operators.ts new file mode 100644 index 00000000..fe5a0715 --- /dev/null +++ b/src/rules/no-nullish-coalescing-operators.ts @@ -0,0 +1,33 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +/** + * Checks if the given token is a nullish coalescing operator or not. + * @param {TSESTree.Token} token - The token to check. + * @returns {boolean} `true` if the token is a nullish coalescing operator. + */ +const isNullishCoalescingOperator = (token: TSESTree.Token): boolean => + token.value === '??' && token.type === 'Punctuator'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-nullish-coalescing-operators', + meta: { + type: 'problem', + docs: { description: 'disallow nullish coalescing operators.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2020 nullish coalescing operators are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + "LogicalExpression[operator='??']"(node: TSESTree.LogicalExpression) { + context.report({ + node: context.getSourceCode().getTokenAfter(node.left, isNullishCoalescingOperator) as TSESTree.Token, + messageId: 'forbidden', + }); + }, + }; + }, +}); diff --git a/src/rules/no-number-epsilon.ts b/src/rules/no-number-epsilon.ts new file mode 100644 index 00000000..09827911 --- /dev/null +++ b/src/rules/no-number-epsilon.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-epsilon', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.EPSILON` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { EPSILON: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-isfinite.ts b/src/rules/no-number-isfinite.ts new file mode 100644 index 00000000..7d477453 --- /dev/null +++ b/src/rules/no-number-isfinite.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-isfinite', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.isFinite` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { isFinite: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-isinteger.ts b/src/rules/no-number-isinteger.ts new file mode 100644 index 00000000..44a96ce6 --- /dev/null +++ b/src/rules/no-number-isinteger.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-isinteger', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.isInteger` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { isInteger: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-isnan.ts b/src/rules/no-number-isnan.ts new file mode 100644 index 00000000..62bff082 --- /dev/null +++ b/src/rules/no-number-isnan.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-isnan', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.isNaN` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { isNaN: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-issafeinteger.ts b/src/rules/no-number-issafeinteger.ts new file mode 100644 index 00000000..2c41845b --- /dev/null +++ b/src/rules/no-number-issafeinteger.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-issafeinteger', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.isSafeInteger` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { isSafeInteger: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-maxsafeinteger.ts b/src/rules/no-number-maxsafeinteger.ts new file mode 100644 index 00000000..7b8390b9 --- /dev/null +++ b/src/rules/no-number-maxsafeinteger.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-maxsafeinteger', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.MAX_SAFE_INTEGER` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { MAX_SAFE_INTEGER: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-minsafeinteger.ts b/src/rules/no-number-minsafeinteger.ts new file mode 100644 index 00000000..637255e8 --- /dev/null +++ b/src/rules/no-number-minsafeinteger.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-minsafeinteger', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.MIN_SAFE_INTEGER` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { MIN_SAFE_INTEGER: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-parsefloat.ts b/src/rules/no-number-parsefloat.ts new file mode 100644 index 00000000..e9d23939 --- /dev/null +++ b/src/rules/no-number-parsefloat.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-parsefloat', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.parseFloat` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { parseFloat: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-number-parseint.ts b/src/rules/no-number-parseint.ts new file mode 100644 index 00000000..7c869948 --- /dev/null +++ b/src/rules/no-number-parseint.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-number-parseint', + meta: { + type: 'problem', + docs: { description: 'disallow the `Number.parseInt` property.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Number: { parseInt: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-numeric-separators.ts b/src/rules/no-numeric-separators.ts new file mode 100644 index 00000000..47eb0037 --- /dev/null +++ b/src/rules/no-numeric-separators.ts @@ -0,0 +1,36 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +/** + * Remove the numeric separators. + * @param {string} raw The raw string of numeric literals + * @returns {string} The string with the separators removed. + */ +const removeNumericSeparators = (raw: string): string => raw.replace(/_/gu, ''); + +export const category = 'ES2021'; +export default createRule<[], 'forbidden'>({ + name: 'no-numeric-separators', + meta: { + type: 'problem', + docs: { description: 'disallow numeric separators.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: 'ES2021 numeric separators are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + Literal(node) { + if ((typeof node.value === 'number' || (node as TSESTree.BigIntLiteral).bigint) && node.raw.includes('_')) { + context.report({ + node, + messageId: 'forbidden', + fix: (fixer) => fixer.replaceText(node, removeNumericSeparators(node.raw)), + }); + } + }, + }; + }, +}); diff --git a/src/rules/no-object-assign.ts b/src/rules/no-object-assign.ts new file mode 100644 index 00000000..d2d82551 --- /dev/null +++ b/src/rules/no-object-assign.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-assign', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.assign` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { assign: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-defineproperties.ts b/src/rules/no-object-defineproperties.ts new file mode 100644 index 00000000..61ff5668 --- /dev/null +++ b/src/rules/no-object-defineproperties.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-defineproperties', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.defineProperties` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { defineProperties: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-defineproperty.ts b/src/rules/no-object-defineproperty.ts new file mode 100644 index 00000000..c8a091ce --- /dev/null +++ b/src/rules/no-object-defineproperty.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-defineproperty', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.defineProperty` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { defineProperty: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-entries.ts b/src/rules/no-object-entries.ts new file mode 100644 index 00000000..dbe2d7b5 --- /dev/null +++ b/src/rules/no-object-entries.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2017'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-entries', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.entries` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2017 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { entries: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-freeze.ts b/src/rules/no-object-freeze.ts new file mode 100644 index 00000000..0bd8e221 --- /dev/null +++ b/src/rules/no-object-freeze.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-freeze', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.freeze` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { freeze: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-fromentries.ts b/src/rules/no-object-fromentries.ts new file mode 100644 index 00000000..35b7b318 --- /dev/null +++ b/src/rules/no-object-fromentries.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2019'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-fromentries', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.fromEntries` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2019 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { fromEntries: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-getownpropertydescriptor.ts b/src/rules/no-object-getownpropertydescriptor.ts new file mode 100644 index 00000000..321e8e7a --- /dev/null +++ b/src/rules/no-object-getownpropertydescriptor.ts @@ -0,0 +1,21 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-getownpropertydescriptor', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.getOwnPropertyDescriptor` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { + Object: { getOwnPropertyDescriptor: { [ASTUtils.ReferenceTracker.READ]: true } }, + }); + }, +}); diff --git a/src/rules/no-object-getownpropertydescriptors.ts b/src/rules/no-object-getownpropertydescriptors.ts new file mode 100644 index 00000000..d76bbade --- /dev/null +++ b/src/rules/no-object-getownpropertydescriptors.ts @@ -0,0 +1,21 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2017'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-getownpropertydescriptors', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.getOwnPropertyDescriptors` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2017 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { + Object: { getOwnPropertyDescriptors: { [ASTUtils.ReferenceTracker.READ]: true } }, + }); + }, +}); diff --git a/src/rules/no-object-getownpropertynames.ts b/src/rules/no-object-getownpropertynames.ts new file mode 100644 index 00000000..62b6ff56 --- /dev/null +++ b/src/rules/no-object-getownpropertynames.ts @@ -0,0 +1,21 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-getownpropertynames', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.getOwnPropertyNames` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { + Object: { getOwnPropertyNames: { [ASTUtils.ReferenceTracker.READ]: true } }, + }); + }, +}); diff --git a/src/rules/no-object-getownpropertysymbols.ts b/src/rules/no-object-getownpropertysymbols.ts new file mode 100644 index 00000000..ff510ebd --- /dev/null +++ b/src/rules/no-object-getownpropertysymbols.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-getownpropertysymbols', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.getOwnPropertySymbols` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { getOwnPropertySymbols: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-getprototypeof.ts b/src/rules/no-object-getprototypeof.ts new file mode 100644 index 00000000..185def6a --- /dev/null +++ b/src/rules/no-object-getprototypeof.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-getprototypeof', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.getPrototypeOf` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { getPrototypeOf: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-is.ts b/src/rules/no-object-is.ts new file mode 100644 index 00000000..4fc80545 --- /dev/null +++ b/src/rules/no-object-is.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-is', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.is` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { is: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-isextensible.ts b/src/rules/no-object-isextensible.ts new file mode 100644 index 00000000..8a83aafb --- /dev/null +++ b/src/rules/no-object-isextensible.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-isextensible', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.isExtensible` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { isExtensible: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-isfrozen.ts b/src/rules/no-object-isfrozen.ts new file mode 100644 index 00000000..ce26c0f2 --- /dev/null +++ b/src/rules/no-object-isfrozen.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-isfrozen', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.isFrozen` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { isFrozen: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-issealed.ts b/src/rules/no-object-issealed.ts new file mode 100644 index 00000000..1c2512fc --- /dev/null +++ b/src/rules/no-object-issealed.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-issealed', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.isSealed` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { isSealed: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-keys.ts b/src/rules/no-object-keys.ts new file mode 100644 index 00000000..6a8da2bd --- /dev/null +++ b/src/rules/no-object-keys.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-keys', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.keys` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { keys: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-preventextensions.ts b/src/rules/no-object-preventextensions.ts new file mode 100644 index 00000000..6e46eac7 --- /dev/null +++ b/src/rules/no-object-preventextensions.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-preventextensions', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.preventExtensions` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { preventExtensions: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-seal.ts b/src/rules/no-object-seal.ts new file mode 100644 index 00000000..0845bd7d --- /dev/null +++ b/src/rules/no-object-seal.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-seal', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.seal` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES5 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { seal: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-setprototypeof.ts b/src/rules/no-object-setprototypeof.ts new file mode 100644 index 00000000..1b502f51 --- /dev/null +++ b/src/rules/no-object-setprototypeof.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-setprototypeof', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.setPrototypeOf` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { setPrototypeOf: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-object-super-properties.ts b/src/rules/no-object-super-properties.ts new file mode 100644 index 00000000..413b0459 --- /dev/null +++ b/src/rules/no-object-super-properties.ts @@ -0,0 +1,45 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +interface IStack { + upper: IStack; + inObjectMethod: boolean; +} + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-super-properties', + meta: { + type: 'problem', + docs: { description: 'disallow `super` property accesses in object literals.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 'super' property accesses in object literals are forbidden." }, + }, + defaultOptions: [], + create(context) { + let stack: IStack | null = null; + + return { + Super(node) { + if (stack?.inObjectMethod) { + context.report({ node, messageId: 'forbidden' }); + } + }, + + ':matches(FunctionExpression, FunctionDeclaration)'( + node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, + ) { + const { type, method } = node.parent as TSESTree.Property; + + stack = { + inObjectMethod: type === 'Property' && !!method, + upper: stack as IStack, + }; + }, + ':matches(FunctionExpression, FunctionDeclaration):exit'() { + stack = stack?.upper as IStack; + }, + }; + }, +}); diff --git a/src/rules/no-object-values.ts b/src/rules/no-object-values.ts new file mode 100644 index 00000000..f124e539 --- /dev/null +++ b/src/rules/no-object-values.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2017'; +export default createRule<[], 'forbidden'>({ + name: 'no-object-values', + meta: { + type: 'problem', + docs: { description: 'disallow the `Object.values` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2017 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Object: { values: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-octal-numeric-literals.ts b/src/rules/no-octal-numeric-literals.ts new file mode 100644 index 00000000..50cba0e2 --- /dev/null +++ b/src/rules/no-octal-numeric-literals.ts @@ -0,0 +1,24 @@ +import { createRule } from '../util/create-rule'; + +const Pattern = /^0[oO]/u; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-octal-numeric-literals', + meta: { + type: 'problem', + docs: { description: 'disallow octal numeric literals.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 octal numeric literals are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + Literal(node) { + if (typeof node.value === 'number' && Pattern.test(node.raw)) { + context.report({ node, messageId: 'forbidden' }); + } + }, + }; + }, +}); diff --git a/src/rules/no-optional-catch-binding.ts b/src/rules/no-optional-catch-binding.ts new file mode 100644 index 00000000..6918a70a --- /dev/null +++ b/src/rules/no-optional-catch-binding.ts @@ -0,0 +1,21 @@ +import { createRule } from '../util/create-rule'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +export const category = 'ES2019'; +export default createRule<[], 'forbidden'>({ + name: 'no-optional-catch-binding', + meta: { + type: 'problem', + docs: { description: 'disallow optional `catch` binding.', recommended: false }, + schema: [], + messages: { forbidden: "ES2019 optional 'catch' binding is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + 'CatchClause[param=null]'(node: TSESTree.CatchClause) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-optional-chaining.ts b/src/rules/no-optional-chaining.ts new file mode 100644 index 00000000..46de83f3 --- /dev/null +++ b/src/rules/no-optional-chaining.ts @@ -0,0 +1,44 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-optional-chaining', + meta: { + type: 'problem', + docs: { description: 'disallow optional chaining.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2020 optional chaining is forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * 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. + */ + const isQuestionDotToken = (token: TSESTree.Token): boolean => + token.value === '?.' && + (token.type === 'Punctuator' || // espree has been parsed well. + // espree@7.1.0 doesn't parse "?." tokens well. Therefore, get the string from the source code and check it. + sourceCode.getText(token as unknown as TSESTree.Node) === '?.'); + + return { + 'CallExpression[optional=true]'(node: TSESTree.CallExpression) { + context.report({ + node: sourceCode.getTokenAfter(node.callee, isQuestionDotToken) as TSESTree.Token, + messageId: 'forbidden', + }); + }, + 'MemberExpression[optional=true]'(node: TSESTree.MemberExpression) { + context.report({ + node: sourceCode.getTokenAfter(node.object, isQuestionDotToken) as TSESTree.Token, + messageId: 'forbidden', + }); + }, + }; + }, +}); diff --git a/src/rules/no-promise-all-settled.ts b/src/rules/no-promise-all-settled.ts new file mode 100644 index 00000000..7ace5712 --- /dev/null +++ b/src/rules/no-promise-all-settled.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2020'; +export default createRule<[], 'forbidden'>({ + name: 'no-promise-all-settled', + meta: { + type: 'problem', + docs: { description: 'disallow `Promise.allSettled` function.', recommended: false }, + schema: [], + messages: { forbidden: "ES2020 'Promise.allSettled' function is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Promise: { allSettled: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-promise-any.ts b/src/rules/no-promise-any.ts new file mode 100644 index 00000000..eab8adcc --- /dev/null +++ b/src/rules/no-promise-any.ts @@ -0,0 +1,22 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2021'; +export default createRule<[], 'forbidden'>({ + name: 'no-promise-any', + meta: { + type: 'problem', + docs: { description: 'disallow `Promise.any` function and `AggregateError` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2021 '{{name}}' is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { + AggregateError: { [ASTUtils.ReferenceTracker.READ]: true }, + Promise: { any: { [ASTUtils.ReferenceTracker.READ]: true } }, + }); + }, +}); diff --git a/src/rules/no-promise-prototype-finally.ts b/src/rules/no-promise-prototype-finally.ts new file mode 100644 index 00000000..5ab28a58 --- /dev/null +++ b/src/rules/no-promise-prototype-finally.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import type { IAggressive } from '../util/define-prototype-method-handler'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; + +export const category = 'ES2018'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-promise-prototype-finally', + meta: { + type: 'problem', + docs: { description: 'disallow the `Promise.prototype.finally` method.', recommended: false }, + schema, + messages: { forbidden: "ES2018 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Promise: ['finally'] }); + }, +}); diff --git a/src/rules/no-promise.ts b/src/rules/no-promise.ts new file mode 100644 index 00000000..b0c4178f --- /dev/null +++ b/src/rules/no-promise.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-promise', + meta: { + type: 'problem', + docs: { description: 'disallow the `Promise` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Promise: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-property-shorthands.ts b/src/rules/no-property-shorthands.ts new file mode 100644 index 00000000..579bd3e1 --- /dev/null +++ b/src/rules/no-property-shorthands.ts @@ -0,0 +1,68 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-property-shorthands', + meta: { + type: 'problem', + docs: { description: 'disallow property shorthands.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: 'ES2015 property shorthands are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Fixes a FunctionExpression node by making it into a longform property. + * @param {TSESLint.RuleFixer} fixer The fixer object + * @param {TSESTree.PropertyNonComputedName} node A `Property` node that has a `FunctionExpression` as its value + * @returns {TSESLint.RuleFix} A fix for this node + */ + const makeFunctionLongform = ( + fixer: TSESLint.RuleFixer, + node: TSESTree.PropertyNonComputedName, + ): TSESLint.RuleFix => { + const firstKeyToken = node.computed + ? sourceCode.getTokenBefore(node.key, ASTUtils.isOpeningBracketToken) + : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed + ? sourceCode.getTokenAfter(node.key, ASTUtils.isClosingBracketToken) + : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken?.range[0], lastKeyToken?.range[1]); + let functionHeader = 'function'; + + if ((node.value as TSESTree.FunctionExpression).async) { + functionHeader = `async ${functionHeader}`; + } + + if ((node.value as TSESTree.FunctionExpression).generator) { + functionHeader = `${functionHeader}*`; + } + + return fixer.replaceTextRange( + [node.range[0], (lastKeyToken as TSESTree.Token).range[1]], + `${keyText}: ${functionHeader}`, + ); + }; + + return { + 'ObjectExpression > :matches(Property[method=true], Property[shorthand=true])'( + node: TSESTree.PropertyNonComputedName, + ) { + context.report({ + node, + messageId: 'forbidden', + fix: node.method + ? (fixer) => makeFunctionLongform(fixer, node) + : (fixer) => fixer.insertTextAfter(node.key, `: ${(node.key as TSESTree.Identifier).name}`), + }); + }, + }; + }, +}); diff --git a/src/rules/no-proxy.ts b/src/rules/no-proxy.ts new file mode 100644 index 00000000..2838ff36 --- /dev/null +++ b/src/rules/no-proxy.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-proxy', + meta: { + type: 'problem', + docs: { description: 'disallow the `Proxy` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Proxy: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-reflect.ts b/src/rules/no-reflect.ts new file mode 100644 index 00000000..b79e2d9d --- /dev/null +++ b/src/rules/no-reflect.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-reflect', + meta: { + type: 'problem', + docs: { description: 'disallow the `Reflect` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Reflect: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-regexp-lookbehind-assertions.ts b/src/rules/no-regexp-lookbehind-assertions.ts new file mode 100644 index 00000000..e256f577 --- /dev/null +++ b/src/rules/no-regexp-lookbehind-assertions.ts @@ -0,0 +1,72 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; +import { RegExpValidator } from 'regexpp'; + +import { createRule } from '../util/create-rule'; +import { getRegExpCalls } from '../util/get-regexp-calls'; + +/** + * Verify a given regular expression. + * @param {TSESLint.RuleContext<'forbidden', []>} context The rule context to report. + * @param {TSESTree.Node} node The AST node to report. + * @param {string} pattern The pattern part of a RegExp. + * @param {string} flags The flags part of a RegExp. + * @returns {void} + */ +const verify = ( + context: TSESLint.RuleContext<'forbidden', []>, + node: TSESTree.Node, + pattern: string, + flags: string, +): void => { + try { + let found = false; + + new RegExpValidator({ + onLookaroundAssertionEnter(_start, kind) { + if (kind === 'lookbehind') { + found = true; + } + }, + }).validatePattern(pattern, 0, pattern.length, flags.includes('u')); + + if (found) { + context.report({ node, messageId: 'forbidden' }); + } + } catch (error) { + if ((error as Error).message.startsWith('Invalid regular expression:')) { + return; + } + + throw error; + } +}; + +export const category = 'ES2018'; +export default createRule<[], 'forbidden'>({ + name: 'no-regexp-lookbehind-assertions', + meta: { + type: 'problem', + docs: { description: 'disallow RegExp lookbehind assertions.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2018 RegExp lookbehind assertions are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + 'Literal[regex]'(node: TSESTree.RegExpLiteral) { + const { pattern, flags } = node.regex; + + verify(context, node, pattern || '', flags || ''); + }, + + 'Program:exit'() { + const scope = context.getScope(); + + for (const { node, pattern, flags } of getRegExpCalls(scope)) { + verify(context, node, pattern ?? '', flags ?? ''); + } + }, + }; + }, +}); diff --git a/src/rules/no-regexp-named-capture-groups.ts b/src/rules/no-regexp-named-capture-groups.ts new file mode 100644 index 00000000..22e9b402 --- /dev/null +++ b/src/rules/no-regexp-named-capture-groups.ts @@ -0,0 +1,77 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; +import { RegExpValidator } from 'regexpp'; + +import { createRule } from '../util/create-rule'; +import { getRegExpCalls } from '../util/get-regexp-calls'; + +/** + * Verify a given regular expression. + * @param {TSESLint.RuleContext<'forbidden', []>} context The rule context to report. + * @param {TSESTree.Node} node The AST node to report. + * @param {string} pattern The pattern part of a RegExp. + * @param {string} flags The flags part of a RegExp. + * @returns {void} + */ +const verify = ( + context: TSESLint.RuleContext<'forbidden', []>, + node: TSESTree.Node, + pattern: string, + flags: string, +): void => { + try { + let found = false; + + new RegExpValidator({ + onCapturingGroupEnter(_start, name) { + if (name) { + found = true; + } + }, + onBackreference(_start, _end, ref) { + if (typeof ref === 'string') { + found = true; + } + }, + }).validatePattern(pattern, 0, pattern.length, flags.includes('u')); + + if (found) { + context.report({ node, messageId: 'forbidden' }); + } + } catch (error) { + if ((error as Error).message.startsWith('Invalid regular expression:')) { + return; + } + + throw error; + } +}; + +export const category = 'ES2018'; +export default createRule<[], 'forbidden'>({ + name: 'no-regexp-named-capture-groups', + meta: { + type: 'problem', + docs: { description: 'disallow RegExp named capture groups.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2018 RegExp named capture groups are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + 'Literal[regex]'(node: TSESTree.RegExpLiteral) { + const { pattern, flags } = node.regex; + + verify(context, node, pattern || '', flags || ''); + }, + + 'Program:exit'() { + const scope = context.getScope(); + + for (const { node, pattern, flags } of getRegExpCalls(scope)) { + verify(context, node, pattern ?? '', flags ?? ''); + } + }, + }; + }, +}); diff --git a/src/rules/no-regexp-prototype-flags.ts b/src/rules/no-regexp-prototype-flags.ts new file mode 100644 index 00000000..4e56751f --- /dev/null +++ b/src/rules/no-regexp-prototype-flags.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-regexp-prototype-flags', + meta: { + type: 'problem', + docs: { description: 'disallow the `RegExp.prototype.flags` property.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' property is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { RegExp: ['flags'] }); + }, +}); diff --git a/src/rules/no-regexp-s-flag.ts b/src/rules/no-regexp-s-flag.ts new file mode 100644 index 00000000..eda71b64 --- /dev/null +++ b/src/rules/no-regexp-s-flag.ts @@ -0,0 +1,35 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; +import { getRegExpCalls } from '../util/get-regexp-calls'; + +export const category = 'ES2018'; +export default createRule<[], 'forbidden'>({ + name: 'no-regexp-s-flag', + meta: { + type: 'problem', + docs: { description: 'disallow RegExp `s` flag.', recommended: false }, + schema: [], + messages: { forbidden: "ES2018 RegExp 's' flag is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + 'Literal[regex]'(node: TSESTree.RegExpLiteral) { + if (node.regex.flags.includes('s')) { + context.report({ node, messageId: 'forbidden' }); + } + }, + + 'Program:exit'() { + const scope = context.getScope(); + + for (const { node, flags } of getRegExpCalls(scope)) { + if (flags?.includes('s')) { + context.report({ node, messageId: 'forbidden' }); + } + } + }, + }; + }, +}); diff --git a/src/rules/no-regexp-u-flag.ts b/src/rules/no-regexp-u-flag.ts new file mode 100644 index 00000000..b46e1a4b --- /dev/null +++ b/src/rules/no-regexp-u-flag.ts @@ -0,0 +1,35 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; +import { getRegExpCalls } from '../util/get-regexp-calls'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-regexp-u-flag', + meta: { + type: 'problem', + docs: { description: 'disallow RegExp `u` flag.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 RegExp 'u' flag is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + 'Literal[regex]'(node: TSESTree.RegExpLiteral) { + if (node.regex.flags.includes('u')) { + context.report({ node, messageId: 'forbidden' }); + } + }, + + 'Program:exit'() { + const scope = context.getScope(); + + for (const { node, flags } of getRegExpCalls(scope)) { + if (flags?.includes('u')) { + context.report({ node, messageId: 'forbidden' }); + } + } + }, + }; + }, +}); diff --git a/src/rules/no-regexp-unicode-property-escapes-2019.ts b/src/rules/no-regexp-unicode-property-escapes-2019.ts new file mode 100644 index 00000000..9f3fae34 --- /dev/null +++ b/src/rules/no-regexp-unicode-property-escapes-2019.ts @@ -0,0 +1,92 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; +import { RegExpValidator } from 'regexpp'; + +import { createRule } from '../util/create-rule'; +import { getRegExpCalls } from '../util/get-regexp-calls'; + +const scNamePattern = /^(?:Script(?:_Extensions)?|scx?)$/u; +const scValuePattern = + /^(?:Dogr|Dogra|Gong|Gunjala_Gondi|Hanifi_Rohingya|Maka|Makasar|Medefaidrin|Medf|Old_Sogdian|Rohg|Sogd|Sogdian|Sogo)$/u; + +const isNewUnicodePropertyKeyValuePair = (key: string, value: string): boolean => + scNamePattern.test(key) && scValuePattern.test(value); + +const isNewBinaryUnicodeProperty = (key: string): boolean => key === 'Extended_Pictographic'; + +/** + * Verify a given regular expression. + * @param {TSESLint.RuleContext<'forbidden', []>} context The rule context to report. + * @param {TSESTree.Node} node The AST node to report. + * @param {string} pattern The pattern part of a RegExp. + * @param {string} flags The flags part of a RegExp. + * @returns {void} + */ +const verify = ( + context: TSESLint.RuleContext<'forbidden', []>, + node: TSESTree.Node, + pattern: string, + flags: string, +): void => { + try { + let foundValue = ''; + + new RegExpValidator({ + onUnicodePropertyCharacterSet(start, end, _kind, key, value) { + if (foundValue) { + return; + } + + if (value ? isNewUnicodePropertyKeyValuePair(key, value) : isNewBinaryUnicodeProperty(key)) { + foundValue = pattern.slice(start, end); + } + }, + }).validatePattern(pattern, 0, pattern.length, flags.includes('u')); + + if (foundValue) { + context.report({ + node, + messageId: 'forbidden', + data: { value: foundValue }, + }); + } + } catch (error) { + if ((error as Error).message.startsWith('Invalid regular expression:')) { + return; + } + + throw error; + } +}; + +export const category = 'ES2019'; +export default createRule<[], 'forbidden'>({ + name: 'no-regexp-unicode-property-escapes-2019', + meta: { + type: 'problem', + docs: { + description: 'disallow the new values of RegExp Unicode property escape sequences in ES2019.', + recommended: false, + }, + schema: [], + messages: { forbidden: "ES2019 '{{value}}' is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + 'Literal[regex]'(node: TSESTree.RegExpLiteral) { + const { pattern, flags } = node.regex; + + verify(context, node, pattern || '', flags || ''); + }, + + 'Program:exit'() { + const scope = context.getScope(); + + for (const { node, pattern, flags } of getRegExpCalls(scope)) { + verify(context, node, pattern ?? '', flags ?? ''); + } + }, + }; + }, +}); diff --git a/src/rules/no-regexp-unicode-property-escapes.ts b/src/rules/no-regexp-unicode-property-escapes.ts new file mode 100644 index 00000000..7cb1ab80 --- /dev/null +++ b/src/rules/no-regexp-unicode-property-escapes.ts @@ -0,0 +1,70 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; +import { RegExpValidator } from 'regexpp'; + +import { createRule } from '../util/create-rule'; +import { getRegExpCalls } from '../util/get-regexp-calls'; + +/** + * Verify a given regular expression. + * @param {TSESLint.RuleContext<'forbidden', []>} context The rule context to report. + * @param {TSESTree.Node} node The AST node to report. + * @param {string} pattern The pattern part of a RegExp. + * @param {string} flags The flags part of a RegExp. + * @returns {void} + */ +const verify = ( + context: TSESLint.RuleContext<'forbidden', []>, + node: TSESTree.Node, + pattern: string, + flags: string, +): void => { + try { + let found = false; + + new RegExpValidator({ + onUnicodePropertyCharacterSet() { + found = true; + }, + }).validatePattern(pattern, 0, pattern.length, flags.includes('u')); + + if (found) { + context.report({ node, messageId: 'forbidden' }); + } + } catch (error) { + if ((error as Error).message.startsWith('Invalid regular expression:')) { + return; + } + + throw error; + } +}; + +export const category = 'ES2018'; +export default createRule<[], 'forbidden'>({ + name: 'no-regexp-unicode-property-escapes', + meta: { + type: 'problem', + docs: { description: 'disallow RegExp Unicode property escape sequences.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2018 RegExp Unicode property escape sequences are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + 'Literal[regex]'(node: TSESTree.RegExpLiteral) { + const { pattern, flags } = node.regex; + + verify(context, node, pattern || '', flags || ''); + }, + + 'Program:exit'() { + const scope = context.getScope(); + + for (const { node, pattern, flags } of getRegExpCalls(scope)) { + verify(context, node, pattern ?? '', flags ?? ''); + } + }, + }; + }, +}); diff --git a/src/rules/no-regexp-y-flag.ts b/src/rules/no-regexp-y-flag.ts new file mode 100644 index 00000000..007a3ded --- /dev/null +++ b/src/rules/no-regexp-y-flag.ts @@ -0,0 +1,35 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; +import { getRegExpCalls } from '../util/get-regexp-calls'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-regexp-y-flag', + meta: { + type: 'problem', + docs: { description: 'disallow RegExp `y` flag.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 RegExp 'y' flag is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + 'Literal[regex]'(node: TSESTree.RegExpLiteral) { + if (node.regex.flags.includes('y')) { + context.report({ node, messageId: 'forbidden' }); + } + }, + + 'Program:exit'() { + const scope = context.getScope(); + + for (const { node, flags } of getRegExpCalls(scope)) { + if (flags?.includes('y')) { + context.report({ node, messageId: 'forbidden' }); + } + } + }, + }; + }, +}); diff --git a/src/rules/no-rest-parameters.ts b/src/rules/no-rest-parameters.ts new file mode 100644 index 00000000..3a433056 --- /dev/null +++ b/src/rules/no-rest-parameters.ts @@ -0,0 +1,22 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-rest-parameters', + meta: { + type: 'problem', + docs: { description: 'disallow rest parameters.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 rest parameters are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':function > RestElement'(node: TSESTree.RestElement) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-rest-spread-properties.ts b/src/rules/no-rest-spread-properties.ts new file mode 100644 index 00000000..83b40d73 --- /dev/null +++ b/src/rules/no-rest-spread-properties.ts @@ -0,0 +1,25 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2018'; +export default createRule<[], 'forbidden'>({ + name: 'no-rest-spread-properties', + meta: { + type: 'problem', + docs: { description: 'disallow rest/spread properties.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2018 rest/spread properties are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + 'ObjectPattern > RestElement'(node: TSESTree.RestElement) { + context.report({ node, messageId: 'forbidden' }); + }, + 'ObjectExpression > SpreadElement'(node: TSESTree.SpreadElement) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-set.ts b/src/rules/no-set.ts new file mode 100644 index 00000000..566e3eb8 --- /dev/null +++ b/src/rules/no-set.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-set', + meta: { + type: 'problem', + docs: { description: 'disallow the `Set` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Set: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-shared-array-buffer.ts b/src/rules/no-shared-array-buffer.ts new file mode 100644 index 00000000..017b0427 --- /dev/null +++ b/src/rules/no-shared-array-buffer.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2017'; +export default createRule<[], 'forbidden'>({ + name: 'no-shared-array-buffer', + meta: { + type: 'problem', + docs: { description: 'disallow the `SharedArrayBuffer` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2017 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { SharedArrayBuffer: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-spread-elements.ts b/src/rules/no-spread-elements.ts new file mode 100644 index 00000000..6b65541b --- /dev/null +++ b/src/rules/no-spread-elements.ts @@ -0,0 +1,22 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-spread-elements', + meta: { + type: 'problem', + docs: { description: 'disallow spread elements.', recommended: false }, + schema: [], + messages: { forbidden: 'ES2015 spread elements are forbidden.' }, + }, + defaultOptions: [], + create(context) { + return { + ':matches(ArrayExpression, CallExpression, NewExpression) > SpreadElement'(node: TSESTree.SpreadElement) { + context.report({ node, messageId: 'forbidden' }); + }, + }; + }, +}); diff --git a/src/rules/no-string-fromcodepoint.ts b/src/rules/no-string-fromcodepoint.ts new file mode 100644 index 00000000..8971cbae --- /dev/null +++ b/src/rules/no-string-fromcodepoint.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-string-fromcodepoint', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.fromCodePoint` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { String: { fromCodePoint: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-string-prototype-codepointat.ts b/src/rules/no-string-prototype-codepointat.ts new file mode 100644 index 00000000..d7f8c9ff --- /dev/null +++ b/src/rules/no-string-prototype-codepointat.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-codepointat', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.codePointAt` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['codePointAt'] }); + }, +}); diff --git a/src/rules/no-string-prototype-endswith.ts b/src/rules/no-string-prototype-endswith.ts new file mode 100644 index 00000000..a7404715 --- /dev/null +++ b/src/rules/no-string-prototype-endswith.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-endswith', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.endsWith` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['endsWith'] }); + }, +}); diff --git a/src/rules/no-string-prototype-includes.ts b/src/rules/no-string-prototype-includes.ts new file mode 100644 index 00000000..320a22a7 --- /dev/null +++ b/src/rules/no-string-prototype-includes.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-includes', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.includes` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['includes'] }); + }, +}); diff --git a/src/rules/no-string-prototype-matchall.ts b/src/rules/no-string-prototype-matchall.ts new file mode 100644 index 00000000..48755a9b --- /dev/null +++ b/src/rules/no-string-prototype-matchall.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2020'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-matchall', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.matchAll` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['matchAll'] }); + }, +}); diff --git a/src/rules/no-string-prototype-normalize.ts b/src/rules/no-string-prototype-normalize.ts new file mode 100644 index 00000000..b69514a8 --- /dev/null +++ b/src/rules/no-string-prototype-normalize.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-normalize', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.normalize` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['normalize'] }); + }, +}); diff --git a/src/rules/no-string-prototype-padstart-padend.ts b/src/rules/no-string-prototype-padstart-padend.ts new file mode 100644 index 00000000..2ef75e33 --- /dev/null +++ b/src/rules/no-string-prototype-padstart-padend.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2017'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-padstart-padend', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.{padStart,padEnd}` methods.', recommended: false }, + schema, + messages: { forbidden: "ES2017 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['padEnd', 'padStart'] }); + }, +}); diff --git a/src/rules/no-string-prototype-repeat.ts b/src/rules/no-string-prototype-repeat.ts new file mode 100644 index 00000000..82ccbaf0 --- /dev/null +++ b/src/rules/no-string-prototype-repeat.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-repeat', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.repeat` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['repeat'] }); + }, +}); diff --git a/src/rules/no-string-prototype-replaceall.ts b/src/rules/no-string-prototype-replaceall.ts new file mode 100644 index 00000000..8ddaa77d --- /dev/null +++ b/src/rules/no-string-prototype-replaceall.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2021'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-replaceall', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.replaceAll` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['replaceAll'] }); + }, +}); diff --git a/src/rules/no-string-prototype-startswith.ts b/src/rules/no-string-prototype-startswith.ts new file mode 100644 index 00000000..2736d4e7 --- /dev/null +++ b/src/rules/no-string-prototype-startswith.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2015'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-startswith', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.startsWith` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['startsWith'] }); + }, +}); diff --git a/src/rules/no-string-prototype-trim.ts b/src/rules/no-string-prototype-trim.ts new file mode 100644 index 00000000..6a055ea9 --- /dev/null +++ b/src/rules/no-string-prototype-trim.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES5'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-trim', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.trim` method.', recommended: false }, + schema, + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['trim'] }); + }, +}); diff --git a/src/rules/no-string-prototype-trimstart-trimend.ts b/src/rules/no-string-prototype-trimstart-trimend.ts new file mode 100644 index 00000000..9b5bc543 --- /dev/null +++ b/src/rules/no-string-prototype-trimstart-trimend.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import type { IAggressive } from '../util/define-prototype-method-handler'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; + +export const category = 'ES2019'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-string-prototype-trimstart-trimend', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.prototype.{trimStart,trimEnd}` methods.', recommended: false }, + schema, + messages: { forbidden: "ES2019 '{{name}}' method is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { String: ['trimEnd', 'trimStart'] }); + }, +}); diff --git a/src/rules/no-string-raw.ts b/src/rules/no-string-raw.ts new file mode 100644 index 00000000..53ea2236 --- /dev/null +++ b/src/rules/no-string-raw.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-string-raw', + meta: { + type: 'problem', + docs: { description: 'disallow the `String.raw` method.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' method is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { String: { raw: { [ASTUtils.ReferenceTracker.READ]: true } } }); + }, +}); diff --git a/src/rules/no-subclassing-builtins.ts b/src/rules/no-subclassing-builtins.ts new file mode 100644 index 00000000..71c13305 --- /dev/null +++ b/src/rules/no-subclassing-builtins.ts @@ -0,0 +1,40 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-subclassing-builtins', + meta: { + type: 'problem', + docs: { description: 'disallow the subclassing of the built-in classes.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 subclassing of '{{name}}' is forbidden." }, + }, + defaultOptions: [], + create(context) { + return { + 'Program:exit'() { + const tracker = new ASTUtils.ReferenceTracker(context.getScope()); + + for (const { node, path } of tracker.iterateGlobalReferences({ + Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Boolean: { [ASTUtils.ReferenceTracker.READ]: true }, + Error: { [ASTUtils.ReferenceTracker.READ]: true }, + RegExp: { [ASTUtils.ReferenceTracker.READ]: true }, + Function: { [ASTUtils.ReferenceTracker.READ]: true }, + Map: { [ASTUtils.ReferenceTracker.READ]: true }, + Number: { [ASTUtils.ReferenceTracker.READ]: true }, + Promise: { [ASTUtils.ReferenceTracker.READ]: true }, + Set: { [ASTUtils.ReferenceTracker.READ]: true }, + String: { [ASTUtils.ReferenceTracker.READ]: true }, + })) { + if (node.parent?.type.startsWith('Class') && (node.parent as TSESTree.ClassExpression).superClass === node) { + context.report({ node, messageId: 'forbidden', data: { name: path.join('.') } }); + } + } + }, + }; + }, +}); diff --git a/src/rules/no-symbol-prototype-description.ts b/src/rules/no-symbol-prototype-description.ts new file mode 100644 index 00000000..52c22f88 --- /dev/null +++ b/src/rules/no-symbol-prototype-description.ts @@ -0,0 +1,18 @@ +import { createRule } from '../util/create-rule'; +import { definePrototypeMethodHandler, schema } from '../util/define-prototype-method-handler'; +import type { IAggressive } from '../util/define-prototype-method-handler'; + +export const category = 'ES2019'; +export default createRule<[options: IAggressive], 'forbidden'>({ + name: 'no-symbol-prototype-description', + meta: { + type: 'problem', + docs: { description: 'disallow the `Symbol.prototype.description` property.', recommended: false }, + schema, + messages: { forbidden: "ES2019 '{{name}}' property is forbidden." }, + }, + defaultOptions: [{}], + create(context) { + return definePrototypeMethodHandler(context, { Symbol: ['description'] }); + }, +}); diff --git a/src/rules/no-symbol.ts b/src/rules/no-symbol.ts new file mode 100644 index 00000000..0ef94040 --- /dev/null +++ b/src/rules/no-symbol.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-symbol', + meta: { + type: 'problem', + docs: { description: 'disallow the `Symbol` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { Symbol: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-template-literals.ts b/src/rules/no-template-literals.ts new file mode 100644 index 00000000..bc28d0e6 --- /dev/null +++ b/src/rules/no-template-literals.ts @@ -0,0 +1,71 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; +import { createRule } from '../util/create-rule'; + +/** + * Checks whether it is string literal + * @param {string} s string source code + * @returns {boolean} true: is string literal source code + */ +const isStringLiteralCode = (s: string): boolean => + (s.startsWith("'") && s.endsWith("'")) || (s.startsWith('"') && s.endsWith('"')); + +/** + * Transform template literal to string concatenation. + * @param {TSESTree.TemplateLiteral} node TemplateLiteral node.(not within TaggedTemplateExpression) + * @param {TSESLint.SourceCode} sourceCode SourceCode + * @returns {string} After transformation + */ +const templateLiteralToStringConcat = (node: TSESTree.TemplateLiteral, sourceCode: TSESLint.SourceCode): string => { + const ss: string[] = []; + + node.quasis.forEach((q, i) => { + const value = q.value.cooked; + + if (value) { + ss.push(JSON.stringify(value)); + } + + if (i < node.expressions.length) { + const e = node.expressions[i]; + const text = sourceCode.getText(e); + + ss.push(text); + } + }); + + if (ss.length === 0 || !isStringLiteralCode(ss[0])) { + ss.unshift('""'); + } + + return ss.join('+'); +}; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-template-literals', + meta: { + type: 'problem', + docs: { description: 'disallow template literals.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: 'ES2015 template literals are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + return { + 'TaggedTemplateExpression, :not(TaggedTemplateExpression) > TemplateLiteral'(node: TSESTree.TemplateLiteral) { + context.report({ + node, + messageId: 'forbidden', + fix: + node.type === 'TemplateLiteral' + ? (fixer) => fixer.replaceText(node, templateLiteralToStringConcat(node, sourceCode)) + : undefined, + }); + }, + }; + }, +}); diff --git a/src/rules/no-trailing-commas.ts b/src/rules/no-trailing-commas.ts new file mode 100644 index 00000000..34df2e5d --- /dev/null +++ b/src/rules/no-trailing-commas.ts @@ -0,0 +1,30 @@ +import { createRule } from '../util/create-rule'; +import { isCommaToken } from '../util/is-comma-token'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +export const category = 'ES5'; +export default createRule<[], 'forbidden'>({ + name: 'no-trailing-commas', + meta: { + type: 'problem', + docs: { description: 'disallow trailing commas in array/object literals.', recommended: false }, + schema: [], + messages: { forbidden: 'ES5 trailing commas in array/object literals are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + return { + 'ArrayExpression, ArrayPattern, ObjectExpression, ObjectPattern'( + node: TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ObjectExpression | TSESTree.ObjectPattern, + ) { + const token = sourceCode.getLastToken(node, 1); + + if (isCommaToken(token)) { + context.report({ node, messageId: 'forbidden' }); + } + }, + }; + }, +}); diff --git a/src/rules/no-trailing-function-commas.ts b/src/rules/no-trailing-function-commas.ts new file mode 100644 index 00000000..e938b1bf --- /dev/null +++ b/src/rules/no-trailing-function-commas.ts @@ -0,0 +1,44 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; +import { isCommaToken } from '../util/is-comma-token'; + +export const category = 'ES2017'; +export default createRule<[], 'forbidden'>({ + name: 'no-trailing-function-commas', + meta: { + type: 'problem', + docs: { description: 'disallow trailing commas in parameter/argument lists.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: 'ES2017 trailing commas in parameter/argument lists are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + return { + ':function'(node: TSESTree.FunctionExpression) { + const { length } = node.params; + + if (length === 0) { + return; + } + + const lastParam = node.params[length - 1]; + const token = sourceCode.getTokenAfter(lastParam); + + if (isCommaToken(token)) { + context.report({ loc: token.loc, messageId: 'forbidden', fix: (fixer) => fixer.remove(token) }); + } + }, + 'CallExpression, NewExpression'(node: TSESTree.CallExpression | TSESTree.NewExpression) { + const token = sourceCode.getLastToken(node, 1); + + if (node.arguments.length > 0 && isCommaToken(token)) { + context.report({ loc: token.loc, messageId: 'forbidden', fix: (fixer) => fixer.remove(token) }); + } + }, + }; + }, +}); diff --git a/src/rules/no-typed-arrays.ts b/src/rules/no-typed-arrays.ts new file mode 100644 index 00000000..4bf8a747 --- /dev/null +++ b/src/rules/no-typed-arrays.ts @@ -0,0 +1,30 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-typed-arrays', + meta: { + type: 'problem', + docs: { description: 'disallow ES2015 typed arrays.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { + Int8Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Uint8Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Uint8ClampedArray: { [ASTUtils.ReferenceTracker.READ]: true }, + Int16Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Uint16Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Int32Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Uint32Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Float32Array: { [ASTUtils.ReferenceTracker.READ]: true }, + Float64Array: { [ASTUtils.ReferenceTracker.READ]: true }, + DataView: { [ASTUtils.ReferenceTracker.READ]: true }, + }); + }, +}); diff --git a/src/rules/no-unicode-codepoint-escapes.ts b/src/rules/no-unicode-codepoint-escapes.ts new file mode 100644 index 00000000..ae7a89d5 --- /dev/null +++ b/src/rules/no-unicode-codepoint-escapes.ts @@ -0,0 +1,87 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import { createRule } from '../util/create-rule'; +import { definePatternSearchGenerator } from '../util/define-pattern-search-generator'; + +const codePointEscapeSearchGenerator = definePatternSearchGenerator(/\\u\{[0-9a-fA-F]+\}/gu); + +/** + * Number to Hex + * @param {number} num number + * @returns {string} hex string + */ +const toHex = (num: number): string => `0000${num.toString(16).toUpperCase()}`.slice(-4); + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-unicode-codepoint-escapes', + meta: { + type: 'problem', + docs: { description: 'disallow Unicode code point escape sequences.', recommended: false }, + fixable: 'code', + schema: [], + messages: { forbidden: 'ES2015 Unicode code point escape sequences are forbidden.' }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * find code point escape, and report + * @param {Node} node node + * @returns {void} + */ + const findAndReport = (node: TSESTree.Node): void => { + const text = sourceCode.getText(node); + + for (const match of codePointEscapeSearchGenerator(text)) { + const start = match.index; + const end = start + match[0].length; + const range = [start + node.range[0], end + node.range[0]]; + + context.report({ + node, + loc: { start: sourceCode.getLocFromIndex(range[0]), end: sourceCode.getLocFromIndex(range[1]) }, + messageId: 'forbidden', + fix: (fixer) => { + const codePointStr = text.slice(start + 3, end - 1); + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint + let codePoint = Number(`0x${codePointStr}`); + let replacement: string | null; + + if (codePoint <= 0xff_ff) { + // BMP code point + replacement = toHex(codePoint); + } else { + // Astral code point; split in surrogate halves + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + codePoint -= 0x1_00_00; + + // eslint-disable-next-line no-bitwise + const highSurrogate = (codePoint >> 10) + 0xd8_00; + const lowSurrogate = (codePoint % 0x4_00) + 0xdc_00; + + replacement = `${toHex(highSurrogate)}\\u${toHex(lowSurrogate)}`; + } + + return fixer.replaceTextRange([range[0] + 2, range[1]], replacement); + }, + }); + } + }; + + return { + Identifier(node) { + findAndReport(node); + }, + Literal(node) { + if (typeof node.value === 'string') { + findAndReport(node); + } + }, + TemplateElement(node) { + findAndReport(node); + }, + }; + }, +}); diff --git a/src/rules/no-weak-map.ts b/src/rules/no-weak-map.ts new file mode 100644 index 00000000..5aef4fcd --- /dev/null +++ b/src/rules/no-weak-map.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-weak-map', + meta: { + type: 'problem', + docs: { description: 'disallow the `WeakMap` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { WeakMap: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-weak-set.ts b/src/rules/no-weak-set.ts new file mode 100644 index 00000000..bd2e60a6 --- /dev/null +++ b/src/rules/no-weak-set.ts @@ -0,0 +1,19 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2015'; +export default createRule<[], 'forbidden'>({ + name: 'no-weak-set', + meta: { + type: 'problem', + docs: { description: 'disallow the `WeakSet` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2015 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { WeakSet: { [ASTUtils.ReferenceTracker.READ]: true } }); + }, +}); diff --git a/src/rules/no-weakrefs.ts b/src/rules/no-weakrefs.ts new file mode 100644 index 00000000..fb3dd3a1 --- /dev/null +++ b/src/rules/no-weakrefs.ts @@ -0,0 +1,22 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +import { createRule } from '../util/create-rule'; +import { referenceTracker } from '../util/reference-tracker'; + +export const category = 'ES2021'; +export default createRule<[], 'forbidden'>({ + name: 'no-weakrefs', + meta: { + type: 'problem', + docs: { description: 'disallow the `WeakRef` and `FinalizationRegistry` class.', recommended: false }, + schema: [], + messages: { forbidden: "ES2021 '{{name}}' class is forbidden." }, + }, + defaultOptions: [], + create(context) { + return referenceTracker(context, { + FinalizationRegistry: { [ASTUtils.ReferenceTracker.READ]: true }, + WeakRef: { [ASTUtils.ReferenceTracker.READ]: true }, + }); + }, +}); diff --git a/src/util/create-rule.ts b/src/util/create-rule.ts new file mode 100644 index 00000000..59dfb940 --- /dev/null +++ b/src/util/create-rule.ts @@ -0,0 +1,5 @@ +import { ESLintUtils } from '@typescript-eslint/experimental-utils'; + +export const createRule = ESLintUtils.RuleCreator( + (name) => `https://github.com/roikoren755/eslint-plugin-es/docs/rules/${name}.md`, +); diff --git a/src/util/define-pattern-search-generator.ts b/src/util/define-pattern-search-generator.ts new file mode 100644 index 00000000..186c3457 --- /dev/null +++ b/src/util/define-pattern-search-generator.ts @@ -0,0 +1,13 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; + +/** + * Define generator to search pattern. + * The iterator generated by the generator returns the start and end index of the match. + * @param {RegExp} pattern Base pattern + * @returns {function(string):IterableIterator} generator + */ +export const definePatternSearchGenerator = (pattern: RegExp): ((s: string) => IterableIterator) => { + const matcher = new ASTUtils.PatternMatcher(pattern); + + return matcher.execAll.bind(matcher); +}; diff --git a/src/util/define-prototype-method-handler.ts b/src/util/define-prototype-method-handler.ts new file mode 100644 index 00000000..c6b89780 --- /dev/null +++ b/src/util/define-prototype-method-handler.ts @@ -0,0 +1,327 @@ +/* eslint-disable max-lines */ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { JSONSchema, TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; +import type * as TypeScript from 'typescript'; + +import { optionalRequire } from './optional-require'; + +type TS = typeof TypeScript; + +const ts = optionalRequire(require, 'typescript'); + +export interface IAggressive { + aggressive?: boolean; +} + +/** + * Get `aggressive` option value. + * @param {RuleContext} context The rule context. + * @returns {boolean} The gotten `aggressive` option value. + */ +const getAggressiveOption = (context: TSESLint.RuleContext): boolean => { + const [options] = context.options; + const globalOptions = context.settings.es; + + if (options && typeof options.aggressive === 'boolean') { + return options.aggressive; + } + + if (globalOptions && typeof (globalOptions as Record).aggressive === 'boolean') { + return (globalOptions as IAggressive).aggressive as boolean; + } + + return false; +}; + +/** + * Check if a given type is an object type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {type is TypeScript.ObjectType} `true` if the type is an object type. + */ +const isObject = (type: TypeScript.Type): type is TypeScript.ObjectType => + // eslint-disable-next-line no-bitwise + (type.flags & (ts as TS).TypeFlags.Object) !== 0; + +/** + * Check if a given type is an anonymous object type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {type is TypeScript.ObjectType} `true` if the type is an anonymous object type. + */ +const isAnonymousObject = (type: TypeScript.Type): type is TypeScript.ObjectType => + // eslint-disable-next-line no-bitwise + isObject(type) && (type.objectFlags & (ts as TS).ObjectFlags.Anonymous) !== 0; + +/** + * Check if a given type is `any` or not. + * @param {TypeScript.Type} type The type to check. + * @returns {boolean} `true` if the type is `any`. + */ +const isAny = (type: TypeScript.Type): boolean => (type.flags & (ts as TS).TypeFlags.Any) !== 0; // eslint-disable-line no-bitwise + +/** + * Check if a given type is an array-like type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {type is TypeScript.ObjectType} `true` if the type is an array-like type. + */ +const isArrayLikeObject = (type: TypeScript.Type): type is TypeScript.ObjectType => + isObject(type) && + // eslint-disable-next-line no-bitwise + (type.objectFlags & + // eslint-disable-next-line no-bitwise + ((ts as TS).ObjectFlags.ArrayLiteral | (ts as TS).ObjectFlags.EvolvingArray | (ts as TS).ObjectFlags.Tuple)) !== + 0; + +/** + * Check if a given type is an interface type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {type is TypeScript.InterfaceType} `true` if the type is an interface type. + */ +const isClassOrInterface = (type: TypeScript.Type): type is TypeScript.InterfaceType => + // eslint-disable-next-line no-bitwise + isObject(type) && (type.objectFlags & (ts as TS).ObjectFlags.ClassOrInterface) !== 0; + +/** + * Check if a given type is a reference type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {type is TypeScript.TypeReference} `true` if the type is a reference type. + */ +const isReferenceObject = (type: TypeScript.Type): type is TypeScript.TypeReference => + // eslint-disable-next-line no-bitwise + isObject(type) && (type.objectFlags & (ts as TS).ObjectFlags.Reference) !== 0; + +/** + * Check if a given type is a string-like type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {boolean} `true` if the type is a string-like type. + */ +const isStringLike = (type: TypeScript.Type): boolean => (type.flags & (ts as TS).TypeFlags.StringLike) !== 0; // eslint-disable-line no-bitwise + +/** + * Check if a given type is a type parameter type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {boolean} `true` if the type is a type parameter type. + */ +const isTypeParameter = (type: TypeScript.Type): boolean => (type.flags & (ts as TS).TypeFlags.TypeParameter) !== 0; // eslint-disable-line no-bitwise + +/** + * Check if a given type is a union-or-intersection type or not. + * @param {TypeScript.Type} type The type to check. + * @returns {type is TypeScript.UnionOrIntersectionType} `true` if the type is a union-or-intersection type. + */ +const isUnionOrIntersection = (type: TypeScript.Type): type is TypeScript.UnionOrIntersectionType => + // eslint-disable-next-line no-bitwise + (type.flags & (ts as TS).TypeFlags.UnionOrIntersection) !== 0; + +/** + * Check if a given type is `unknown` or not. + * @param {TypeScript.Type} type The type to check. + * @returns {boolean} `true` if the type is `unknown`. + */ +const isUnknown = (type: TypeScript.Type): boolean => (type.flags & (ts as TS).TypeFlags.Unknown) !== 0; // eslint-disable-line no-bitwise + +/** + * Define handlers to disallow prototype methods. + * @param {TSESLint.RuleContext<'forbidden', readonly []>} context The rule context. + * @param {Record} nameMap The method names to disallow. The key is class names and that value is method names. + * @returns {TSESLint.RuleFunction} The defined handlers. + */ +export const definePrototypeMethodHandler = ( + context: TSESLint.RuleContext<'forbidden', [options: IAggressive]>, + nameMap: Record, +): TSESLint.RuleListener => { + const aggressive = getAggressiveOption(context); + + const tsNodeMap = context.parserServices?.esTreeNodeToTSNodeMap; + const checker = context.parserServices?.program?.getTypeChecker(); + + const isTS = Boolean(ts && tsNodeMap && checker); + const hasFullType = isTS && context.parserServices?.hasFullTypeInformation !== false; + + /** + * Get the constraint type of a given type parameter type if exists. + * + * `type.getConstraint()` method doesn't return the constraint type of the + * type parameter for some reason. So this gets the constraint type via AST. + * + * @param {TypeScript.TypeParameter} type The type parameter type to get. + * @returns {TypeScript.Type | undefined} The constraint type. + */ + const getConstraintType = (type: TypeScript.TypeParameter): TypeScript.Type | undefined => { + const { symbol } = type; + const declarations = symbol?.declarations; + const declaration = declarations?.[0]; + + if ( + ts?.isTypeParameterDeclaration(declaration as TypeScript.Declaration) && + (declaration as TypeScript.TypeParameterDeclaration).constraint + ) { + return checker?.getTypeFromTypeNode( + (declaration as TypeScript.TypeParameterDeclaration).constraint as TypeScript.TypeNode, + ); + } + + // eslint-disable-next-line consistent-return + return undefined; + }; + + /** + * Check if the name of the given type is expected or not. + * @param {TypeScript.Type} type The type to check. + * @param {string} className The expected type name. + * @returns {boolean} `true` if should disallow it. + */ + const typeEquals = (type: TypeScript.Type, className: string): boolean => { + if (isAny(type) || isUnknown(type)) { + return aggressive; + } + + if (isAnonymousObject(type)) { + // In non full-type mode, array types (e.g. `any[]`) become anonymous object type. + return hasFullType ? false : aggressive; + } + + if (isStringLike(type)) { + return className === 'String'; + } + + if (isArrayLikeObject(type)) { + return className === 'Array'; + } + + if (isReferenceObject(type) && type.target !== type) { + return typeEquals(type.target, className); + } + + if (isTypeParameter(type)) { + const constraintType = getConstraintType(type); + + if (constraintType) { + return typeEquals(constraintType, className); + } + + return hasFullType ? false : aggressive; + } + + if (isUnionOrIntersection(type)) { + return type.types.some((t) => typeEquals(t, className)); + } + + if (isClassOrInterface(type)) { + const name = type.symbol.escapedName; + + return name === className || name === `Readonly${className}`; + } + + return checker?.typeToString(type) === className; + }; + + /** + * Check if the type of the given node by the declaration of `node.property`. + * @param {MemberExpression} memberAccessNode The MemberExpression node. + * @param {string} className The class name to disallow. + * @returns {boolean} `true` if should disallow it. + */ + const checkByPropertyDeclaration = (memberAccessNode: TSESTree.MemberExpression, className: string): boolean => { + const tsNode = tsNodeMap?.get(memberAccessNode.property); + const symbol = tsNode && checker?.getSymbolAtLocation(tsNode); + const declarations = symbol?.declarations; + + if (declarations) { + for (const declaration of declarations) { + const type = checker?.getTypeAtLocation(declaration.parent); + + if (type && typeEquals(type, className)) { + return true; + } + } + } + + return false; + }; + + /** + * Check if the type of the given node by the type of `node.object`. + * @param {MemberExpression} memberAccessNode The MemberExpression node. + * @param {string} className The class name to disallow. + * @returns {boolean} `true` if should disallow it. + */ + const checkByObjectExpressionType = (memberAccessNode: TSESTree.MemberExpression, className: string): boolean => { + const tsNode = tsNodeMap?.get(memberAccessNode.object); + const type = checker?.getTypeAtLocation(tsNode as TypeScript.Node); + + return typeEquals(type as TypeScript.Type, className); + }; + + /** + * Check if the type of the given node is one of given class or not. + * @param {MemberExpression} memberAccessNode The MemberExpression node. + * @param {string} className The class name to disallow. + * @returns {boolean} `true` if should disallow it. + */ + const checkObjectType = (memberAccessNode: TSESTree.MemberExpression, className: string): boolean => { + // If it's obvious, shortcut. + if (memberAccessNode.object.type === 'ArrayExpression') { + return className === 'Array'; + } + + if (memberAccessNode.object.type === 'Literal' && (memberAccessNode.object as TSESTree.RegExpLiteral).regex) { + return className === 'RegExp'; + } + + if ( + (memberAccessNode.object.type === 'Literal' && typeof memberAccessNode.object.value === 'string') || + memberAccessNode.object.type === 'TemplateLiteral' + ) { + return className === 'String'; + } + + // Test object type. + return isTS + ? checkByPropertyDeclaration(memberAccessNode, className) || + checkByObjectExpressionType(memberAccessNode, className) + : aggressive; + }; + + // For performance + const nameMapEntries = Object.entries(nameMap); + + if (nameMapEntries.length === 1) { + const [[className, methodNames]] = nameMapEntries; + + return { + MemberExpression(node) { + const propertyName = ASTUtils.getPropertyName(node, context.getScope()); + + if (methodNames.includes(propertyName as string) && checkObjectType(node, className)) { + context.report({ + node, + messageId: 'forbidden', + data: { name: `${className}.prototype.${propertyName as string}` }, + }); + } + }, + }; + } + + return { + MemberExpression(node) { + const propertyName = ASTUtils.getPropertyName(node, context.getScope()); + + for (const [className, methodNames] of nameMapEntries) { + if (methodNames.includes(propertyName as string) && checkObjectType(node, className)) { + context.report({ + node, + messageId: 'forbidden', + data: { name: `${className}.prototype.${propertyName as string}` }, + }); + + return; + } + } + }, + }; +}; + +export const schema: JSONSchema.JSONSchema4 = [ + { type: 'object', properties: { aggressive: { type: 'boolean' } }, additionalProperties: false }, +]; diff --git a/src/util/get-regexp-calls.ts b/src/util/get-regexp-calls.ts new file mode 100644 index 00000000..bd664954 --- /dev/null +++ b/src/util/get-regexp-calls.ts @@ -0,0 +1,26 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +/** + * Iterate the calls of the `RegExp` global variable. + * @param {Scope} globalScope The global scope object. + * @returns {IterableIterator<{node:Node,pattern:(string|null),flags:(string|null)}>} The iterator of `CallExpression` or `NewExpression` for `RegExp`. + */ +export function* getRegExpCalls( + globalScope: TSESLint.Scope.Scope, +): IterableIterator<{ node: TSESTree.Node; pattern: string | null; flags: string | null }> { + const tracker = new ASTUtils.ReferenceTracker(globalScope); + + for (const { node } of tracker.iterateGlobalReferences({ + RegExp: { [ASTUtils.ReferenceTracker.CALL]: true, [ASTUtils.ReferenceTracker.CONSTRUCT]: true }, + })) { + const [patternNode, flagsNode] = (node as TSESTree.CallExpression).arguments; + + yield { + node, + pattern: ASTUtils.getStringIfConstant(patternNode, globalScope), + flags: ASTUtils.getStringIfConstant(flagsNode, globalScope), + }; + } +} diff --git a/src/util/is-comma-token.ts b/src/util/is-comma-token.ts new file mode 100644 index 00000000..ad997eb1 --- /dev/null +++ b/src/util/is-comma-token.ts @@ -0,0 +1,9 @@ +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +/** + * Check whether a 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. + */ +export const isCommaToken = (token: TSESTree.Token | null): token is TSESTree.Token => + token?.type === 'Punctuator' && token.value === ','; diff --git a/src/util/optional-require.ts b/src/util/optional-require.ts new file mode 100644 index 00000000..df11e9b1 --- /dev/null +++ b/src/util/optional-require.ts @@ -0,0 +1,17 @@ +/** + * Load a module optionally. + * @param {Function} originalRequire The original `require` function. + * @param {string} id The module specifier. + */ +export const optionalRequire = (originalRequire: (id: string) => T, id: string): T | undefined => { + try { + return originalRequire(id); + } catch (error) { + if ((error as { code?: string })?.code === 'MODULE_NOT_FOUND') { + // eslint-disable-next-line consistent-return + return undefined; + } + + throw error; + } +}; diff --git a/src/util/reference-tracker.ts b/src/util/reference-tracker.ts new file mode 100644 index 00000000..4c230d41 --- /dev/null +++ b/src/util/reference-tracker.ts @@ -0,0 +1,15 @@ +import { ASTUtils } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; + +export const referenceTracker = ( + context: TSESLint.RuleContext<'forbidden', readonly []>, + traceMap: ASTUtils.ReferenceTracker.TraceMap, +): TSESLint.RuleListener => ({ + 'Program:exit'() { + const tracker = new ASTUtils.ReferenceTracker(context.getScope()); + + for (const { node, path } of tracker.iterateGlobalReferences(traceMap)) { + context.report({ node, messageId: 'forbidden', data: { name: path.join('.') } }); + } + }, +}); diff --git a/tests/fixtures/test.ts b/tests/fixtures/test.ts new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/tests/fixtures/test.ts @@ -0,0 +1 @@ +'use strict'; diff --git a/tests/fixtures/tsconfig.json b/tests/fixtures/tsconfig.json new file mode 100644 index 00000000..794213da --- /dev/null +++ b/tests/fixtures/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "strict": true, + "lib": ["ES2020"] + }, + "include": ["test.ts"] +} diff --git a/tests/src/rules/no-accessor-properties.ts b/tests/src/rules/no-accessor-properties.ts new file mode 100644 index 00000000..499e32de --- /dev/null +++ b/tests/src/rules/no-accessor-properties.ts @@ -0,0 +1,26 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-accessor-properties'; + +new RuleTester().run('no-accessor-properties', rule, { + valid: ['({ get: function() {} })', '({ set: function() {} })', '({ get() {} })', '({ set(value) {} })'], + invalid: [ + { + code: '({ get a() {} })', + errors: [{ messageId: 'forbidden', column: 4, line: 1, type: AST_NODE_TYPES.Property, data: {} }], + }, + { + code: '({ set a(value) {} })', + errors: [{ messageId: 'forbidden', column: 4, line: 1, type: AST_NODE_TYPES.Property, data: {} }], + }, + { + code: 'class A { get a() {} }', + errors: [{ messageId: 'forbidden', column: 11, line: 1, type: AST_NODE_TYPES.MethodDefinition, data: {} }], + }, + { + code: 'class A { set a(value) {} }', + errors: [{ messageId: 'forbidden', column: 11, line: 1, type: AST_NODE_TYPES.MethodDefinition, data: {} }], + }, + ], +}); diff --git a/tests/src/rules/no-array-from.ts b/tests/src/rules/no-array-from.ts new file mode 100644 index 00000000..dbff7492 --- /dev/null +++ b/tests/src/rules/no-array-from.ts @@ -0,0 +1,22 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-from'; + +new RuleTester().run('no-array-from', rule, { + valid: ['Array', 'Array.of', 'let Array = 0; Array.from'], + invalid: [ + { + code: 'Array.from', + errors: [ + { + messageId: 'forbidden', + column: 1, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.from' }, + }, + ], + }, + ], +}); diff --git a/tests/src/rules/no-array-isarray.ts b/tests/src/rules/no-array-isarray.ts new file mode 100644 index 00000000..f688403b --- /dev/null +++ b/tests/src/rules/no-array-isarray.ts @@ -0,0 +1,22 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-isarray'; + +new RuleTester().run('no-array-isarray', rule, { + valid: ['Array', 'Array.from', 'let Array = 0; Array.isArray'], + invalid: [ + { + code: 'Array.isArray', + errors: [ + { + messageId: 'forbidden', + column: 1, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.isArray' }, + }, + ], + }, + ], +}); diff --git a/tests/src/rules/no-array-of.ts b/tests/src/rules/no-array-of.ts new file mode 100644 index 00000000..17e274e5 --- /dev/null +++ b/tests/src/rules/no-array-of.ts @@ -0,0 +1,22 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-of'; + +new RuleTester().run('no-array-of', rule, { + valid: ['Array', 'Array.from', 'let Array = 0; Array.of'], + invalid: [ + { + code: 'Array.of', + errors: [ + { + messageId: 'forbidden', + column: 1, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.of' }, + }, + ], + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-copywithin.ts b/tests/src/rules/no-array-prototype-copywithin.ts new file mode 100644 index 00000000..bbe9d486 --- /dev/null +++ b/tests/src/rules/no-array-prototype-copywithin.ts @@ -0,0 +1,123 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-copywithin'; + +const ruleId = 'no-array-prototype-copywithin'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.copyWithin' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'copyWithin(0, 1, 2)', + 'foo.reverse()', + 'foo.copyWithin(0, 1, 2)', + { code: 'copyWithin(0, 1, 2)', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.copyWithin(0, 1, 2)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.copyWithin(0, 1, 2)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.copyWithin(0, 1, 2)', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'copyWithin(0, 1, 2)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.copyWithin(0, 1, 2)' }, + { filename, code: 'let foo = {}; foo.copyWithin(0, 1, 2)' }, + { filename, code: 'copyWithin(0, 1, 2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.copyWithin(0, 1, 2)' }, + { filename, code: 'let foo = Array(); foo.copyWithin(0, 1, 2)' }, + { filename, code: 'function f(a: T) { a.copyWithin(0, 1, 2) }' }, + { filename, code: 'function f(a: T) { a.copyWithin(0, 1, 2) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].copyWithin(0, 1, 2)', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.copyWithin(0, 1, 2)', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.copyWithin(0, 1, 2)', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.copyWithin(0, 1, 2) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.copyWithin(0, 1, 2) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'foo.copyWithin(0, 1, 2)', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'copyWithin(0, 1, 2)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.copyWithin(0, 1, 2)' }, + { filename, code: 'let foo = {}; foo.copyWithin(0, 1, 2)' }, + { filename, code: 'copyWithin(0, 1, 2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].copyWithin(0, 1, 2)', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.copyWithin(0, 1, 2)', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.copyWithin(0, 1, 2)', errors: [{ ...error, column: 20 }] }, + { + filename, + code: 'function f(a: T) { a.copyWithin(0, 1, 2) }', + errors: [{ ...error, column: 37 }], + }, + { + filename, + code: 'function f(a: T) { a.copyWithin(0, 1, 2) }', + errors: [{ ...error, column: 51 }], + }, + { + filename, + code: 'foo.copyWithin(0, 1, 2)', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-entries.ts b/tests/src/rules/no-array-prototype-entries.ts new file mode 100644 index 00000000..f5c68933 --- /dev/null +++ b/tests/src/rules/no-array-prototype-entries.ts @@ -0,0 +1,110 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-entries'; + +const ruleId = 'no-array-prototype-entries'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.entries' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'entries()', + 'foo.reverse()', + 'foo.entries()', + { code: 'entries()', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.entries()', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.entries()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.entries()', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'entries()' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.entries()' }, + { filename, code: 'let foo = {}; foo.entries()' }, + { filename, code: 'entries()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.entries()' }, + { filename, code: 'let foo = Array(); foo.entries()' }, + { filename, code: 'function f(a: T) { a.entries() }' }, + { filename, code: 'function f(a: T) { a.entries() }' }, + ], + invalid: [ + { filename, code: '[a, b, c].entries()', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.entries()', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.entries()', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.entries() }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.entries() }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.entries()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'entries()' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.entries()' }, + { filename, code: 'let foo = {}; foo.entries()' }, + { filename, code: 'entries()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].entries()', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.entries()', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.entries()', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.entries() }', errors: [{ ...error, column: 37 }] }, + { filename, code: 'function f(a: T) { a.entries() }', errors: [{ ...error, column: 46 }] }, + { + filename, + code: 'function f(a: T) { a.entries() }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.entries()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-every.ts b/tests/src/rules/no-array-prototype-every.ts new file mode 100644 index 00000000..d93270b5 --- /dev/null +++ b/tests/src/rules/no-array-prototype-every.ts @@ -0,0 +1,114 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-every'; + +const ruleId = 'no-array-prototype-every'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.every' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'every(() => {})', + 'foo.reverse()', + 'foo.every(() => {})', + { code: 'every(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.every(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.every(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.every(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'every(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.every(() => {})' }, + { filename, code: 'let foo = {}; foo.every(() => {})' }, + { filename, code: 'every(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.every(() => {})' }, + { filename, code: 'let foo = Array(); foo.every(() => {})' }, + { filename, code: 'function f(a: T) { a.every(() => {}) }' }, + { filename, code: 'function f(a: T) { a.every(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].every(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.every(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.every(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.every(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.every(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.every(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'every(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.every(() => {})' }, + { filename, code: 'let foo = {}; foo.every(() => {})' }, + { filename, code: 'every(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].every(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.every(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.every(() => {})', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.every(() => {}) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.every(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.every(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.every(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-fill.ts b/tests/src/rules/no-array-prototype-fill.ts new file mode 100644 index 00000000..7f0747a8 --- /dev/null +++ b/tests/src/rules/no-array-prototype-fill.ts @@ -0,0 +1,110 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-fill'; + +const ruleId = 'no-array-prototype-fill'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.fill' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'fill(0)', + 'foo.reverse()', + 'foo.fill(0)', + { code: 'fill(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.fill(0)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.fill(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.fill(0)', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'fill(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.fill(0)' }, + { filename, code: 'let foo = {}; foo.fill(0)' }, + { filename, code: 'fill(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.fill(0)' }, + { filename, code: 'let foo = Array(); foo.fill(0)' }, + { filename, code: 'function f(a: T) { a.fill(0) }' }, + { filename, code: 'function f(a: T) { a.fill(0) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].fill(0)', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.fill(0)', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.fill(0)', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.fill(0) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.fill(0) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.fill(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'fill(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.fill(0)' }, + { filename, code: 'let foo = {}; foo.fill(0)' }, + { filename, code: 'fill(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].fill(0)', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.fill(0)', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.fill(0)', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.fill(0) }', errors: [{ ...error, column: 37 }] }, + { filename, code: 'function f(a: T) { a.fill(0) }', errors: [{ ...error, column: 46 }] }, + { + filename, + code: 'function f(a: T) { a.fill(0) }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.fill(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-filter.ts b/tests/src/rules/no-array-prototype-filter.ts new file mode 100644 index 00000000..2387d763 --- /dev/null +++ b/tests/src/rules/no-array-prototype-filter.ts @@ -0,0 +1,124 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-filter'; + +const ruleId = 'no-array-prototype-filter'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.filter' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'filter(() => {})', + 'foo.reverse()', + 'foo.filter(() => {})', + { code: 'filter(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.filter(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.filter(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.filter(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'filter(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.filter(() => {})' }, + { filename, code: 'let foo = {}; foo.filter(() => {})' }, + { filename, code: 'filter(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.filter(() => {})' }, + { filename, code: 'let foo = Array(); foo.filter(() => {})' }, + { filename, code: 'function f(a: T) { a.filter(() => {}) }' }, + { filename, code: 'function f(a: T) { a.filter(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].filter(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.filter(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.filter(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.filter(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.filter(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'foo.filter(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'filter(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.filter(() => {})' }, + { filename, code: 'let foo = {}; foo.filter(() => {})' }, + { filename, code: 'filter(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].filter(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.filter(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.filter(() => {})', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.filter(() => {}) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.filter(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.filter(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { + filename, + code: 'foo.filter(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-find.ts b/tests/src/rules/no-array-prototype-find.ts new file mode 100644 index 00000000..5946dec9 --- /dev/null +++ b/tests/src/rules/no-array-prototype-find.ts @@ -0,0 +1,114 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-find'; + +const ruleId = 'no-array-prototype-find'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.find' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'find(() => {})', + 'foo.reverse()', + 'foo.find(() => {})', + { code: 'find(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.find(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.find(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.find(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'find(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.find(() => {})' }, + { filename, code: 'let foo = {}; foo.find(() => {})' }, + { filename, code: 'find(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.find(() => {})' }, + { filename, code: 'let foo = Array(); foo.find(() => {})' }, + { filename, code: 'function f(a: T) { a.find(() => {}) }' }, + { filename, code: 'function f(a: T) { a.find(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].find(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.find(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.find(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.find(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.find(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.find(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'find(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.find(() => {})' }, + { filename, code: 'let foo = {}; foo.find(() => {})' }, + { filename, code: 'find(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].find(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.find(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.find(() => {})', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.find(() => {}) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.find(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.find(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.find(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-findindex.ts b/tests/src/rules/no-array-prototype-findindex.ts new file mode 100644 index 00000000..08f1f2c5 --- /dev/null +++ b/tests/src/rules/no-array-prototype-findindex.ts @@ -0,0 +1,128 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-findindex'; + +const ruleId = 'no-array-prototype-findIndex'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.findIndex' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'findIndex(() => {})', + 'foo.reverse()', + 'foo.findIndex(() => {})', + { code: 'findIndex(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.findIndex(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.findIndex(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.findIndex(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'findIndex(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.findIndex(() => {})' }, + { filename, code: 'let foo = {}; foo.findIndex(() => {})' }, + { filename, code: 'findIndex(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.findIndex(() => {})' }, + { filename, code: 'let foo = Array(); foo.findIndex(() => {})' }, + { filename, code: 'function f(a: T) { a.findIndex(() => {}) }' }, + { filename, code: 'function f(a: T) { a.findIndex(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].findIndex(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.findIndex(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.findIndex(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.findIndex(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.findIndex(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'foo.findIndex(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'findIndex(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.findIndex(() => {})' }, + { filename, code: 'let foo = {}; foo.findIndex(() => {})' }, + { filename, code: 'findIndex(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].findIndex(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.findIndex(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.findIndex(() => {})', errors: [{ ...error, column: 20 }] }, + { + filename, + code: 'function f(a: T) { a.findIndex(() => {}) }', + errors: [{ ...error, column: 37 }], + }, + { + filename, + code: 'function f(a: T) { a.findIndex(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.findIndex(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { + filename, + code: 'foo.findIndex(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-flat.ts b/tests/src/rules/no-array-prototype-flat.ts new file mode 100644 index 00000000..ecbb2434 --- /dev/null +++ b/tests/src/rules/no-array-prototype-flat.ts @@ -0,0 +1,132 @@ +import path from 'path'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-flat'; + +const ruleId = 'no-array-prototype-flat'; +const error = (map?: boolean): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: `Array.prototype.flat${map ? 'Map' : ''}` }, +}); + +new RuleTester().run(ruleId, rule, { + valid: [ + 'flat(1)', + 'flatMap(() => {})', + 'foo.reverse()', + 'foo.flat(1)', + 'foo.flatMap(() => {})', + { code: 'flat(1)', settings: { es: { aggressive: true } } }, + { code: 'flatMap(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.flat(1)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.flat(1)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + { code: 'foo.flatMap(() => {})', errors: [{ ...error(true), column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.flat(1)', + options: [{ aggressive: true }], + errors: [{ ...error(), column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'flat(1)' }, + { filename, code: 'flatMap(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.flat(1)' }, + { filename, code: 'foo.flatMap(() => {})' }, + { filename, code: 'let foo = {}; foo.flat(1)' }, + { filename, code: 'let foo = {}; foo.flatMap(() => {})' }, + { filename, code: 'flat(1)', settings: { es: { aggressive: true } } }, + { filename, code: 'flatMap(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.flat(1)' }, + { filename, code: 'let foo = Array(); foo.flat(1)' }, + { filename, code: 'function f(a: T) { a.flat(1) }' }, + { filename, code: 'function f(a: T) { a.flat(1) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].flat(1)', errors: [{ ...error(), column: 1 }] }, + { filename, code: '[a, b, c].flatMap(() => {})', errors: [{ ...error(true), column: 1 }] }, + { + filename, + code: 'let foo = []; foo.flat(1)', + errors: [{ ...error(), column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.flat(1)', + errors: [{ ...error(), column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.flat(1) }', + errors: [{ ...error(), column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.flat(1) }', + errors: [{ ...error(), column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.flat(1)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'flat(1)' }, + { filename, code: 'flatMap(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.flat(1)' }, + { filename, code: 'foo.flatMap(() => {})' }, + { filename, code: 'let foo = {}; foo.flat(1)' }, + { filename, code: 'let foo = {}; foo.flatMap(() => {})' }, + { filename, code: 'flat(1)', settings: { es: { aggressive: true } } }, + { filename, code: 'flatMap(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].flat(1)', errors: [{ ...error(), column: 1 }] }, + { filename, code: '[a, b, c].flatMap(() => {})', errors: [{ ...error(true), column: 1 }] }, + { filename, code: 'let foo = []; foo.flat(1)', errors: [{ ...error(), column: 15 }] }, + { filename, code: 'let foo = []; foo.flatMap(() => {})', errors: [{ ...error(true), column: 15 }] }, + { filename, code: 'let foo = Array(); foo.flat(1)', errors: [{ ...error(), column: 20 }] }, + { filename, code: 'function f(a: T) { a.flat(1) }', errors: [{ ...error(), column: 37 }] }, + { filename, code: 'function f(a: T) { a.flat(1) }', errors: [{ ...error(), column: 46 }] }, + { + filename, + code: 'function f(a: T) { a.flat(1) }', + errors: [{ ...error(), column: 51 }], + }, + { filename, code: 'foo.flat(1)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + { + filename, + code: 'foo.flatMap(() => {})', + errors: [{ ...error(true), column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-foreach.ts b/tests/src/rules/no-array-prototype-foreach.ts new file mode 100644 index 00000000..65d0584b --- /dev/null +++ b/tests/src/rules/no-array-prototype-foreach.ts @@ -0,0 +1,124 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-foreach'; + +const ruleId = 'no-array-prototype-foreach'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.forEach' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'forEach(() => {})', + 'foo.reverse()', + 'foo.forEach(() => {})', + { code: 'forEach(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.forEach(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.forEach(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.forEach(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'forEach(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.forEach(() => {})' }, + { filename, code: 'let foo = {}; foo.forEach(() => {})' }, + { filename, code: 'forEach(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.forEach(() => {})' }, + { filename, code: 'let foo = Array(); foo.forEach(() => {})' }, + { filename, code: 'function f(a: T) { a.forEach(() => {}) }' }, + { filename, code: 'function f(a: T) { a.forEach(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].forEach(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.forEach(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.forEach(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.forEach(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.forEach(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'foo.forEach(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'forEach(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.forEach(() => {})' }, + { filename, code: 'let foo = {}; foo.forEach(() => {})' }, + { filename, code: 'forEach(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].forEach(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.forEach(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.forEach(() => {})', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.forEach(() => {}) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.forEach(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.forEach(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { + filename, + code: 'foo.forEach(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-includes.ts b/tests/src/rules/no-array-prototype-includes.ts new file mode 100644 index 00000000..07bb2ed9 --- /dev/null +++ b/tests/src/rules/no-array-prototype-includes.ts @@ -0,0 +1,136 @@ +import path from 'path'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-includes'; + +const ruleId = 'no-array-prototype-includes'; +const error = (className?: string): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: `${className ?? ''}Array.prototype.includes` }, +}); + +new RuleTester().run(ruleId, rule, { + valid: [ + 'includes(0)', + 'foo.reverse()', + 'foo.includes(0)', + { code: 'includes(0)', settings: { es: { aggressive: true } } }, + { code: "'foo'.includes(0)", settings: { es: { aggressive: true } } }, + { code: '`foo`.includes(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.includes(0)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.includes(0)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.includes(0)', + options: [{ aggressive: true }], + errors: [{ ...error(), column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'includes(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.includes(0)' }, + { filename, code: 'let foo = {}; foo.includes(0)' }, + { filename, code: 'includes(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: "'foo'.includes(0)", settings: { es: { aggressive: true } } }, + { code: '`foo`.includes(0)', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.includes(0)' }, + { filename, code: 'let foo = Array(); foo.includes(0)' }, + { filename, code: 'function f(a: T) { a.includes(0) }' }, + { filename, code: 'function f(a: T) { a.includes(0) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].includes(0)', errors: [{ ...error(), column: 1 }] }, + { + filename, + code: 'let foo = []; foo.includes(0)', + errors: [{ ...error(), column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.includes(0)', + errors: [{ ...error(), column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.includes(0) }', + errors: [{ ...error(), column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.includes(0) }', + errors: [{ ...error(), column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.includes(0)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'includes(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.includes(0)' }, + { filename, code: 'let foo = {}; foo.includes(0)' }, + { filename, code: 'includes(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].includes(0)', errors: [{ ...error(), column: 1 }] }, + { filename, code: 'let foo = []; foo.includes(0)', errors: [{ ...error(), column: 15 }] }, + { filename, code: 'let foo = Array(); foo.includes(0)', errors: [{ ...error(), column: 20 }] }, + { filename, code: 'function f(a: T) { a.includes(0) }', errors: [{ ...error(), column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.includes(0) }', + errors: [{ ...error(), column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.includes(0) }', + errors: [{ ...error(), column: 51 }], + }, + ...[ + 'Int8', + 'Uint8', + 'Uint8Clamped', + 'Int16', + 'Uint16', + 'Int32', + 'Uint32', + 'Float32', + 'Float64', + 'BigInt64', + 'BigUint64', + ].map((className) => ({ + filename, + code: `let foo = new ${className}Array(10); foo.includes(0)`, + errors: [{ ...error(className), column: className.length + 26 }], + })), + { filename, code: 'foo.includes(0)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-indexof.ts b/tests/src/rules/no-array-prototype-indexof.ts new file mode 100644 index 00000000..86717a77 --- /dev/null +++ b/tests/src/rules/no-array-prototype-indexof.ts @@ -0,0 +1,114 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-indexof'; + +const ruleId = 'no-array-prototype-indexof'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.indexOf' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'indexOf(0)', + 'foo.reverse()', + 'foo.indexOf(0)', + { code: 'indexOf(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.indexOf(0)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.indexOf(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.indexOf(0)', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'indexOf(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.indexOf(0)' }, + { filename, code: 'let foo = {}; foo.indexOf(0)' }, + { filename, code: 'indexOf(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.indexOf(0)' }, + { filename, code: 'let foo = Array(); foo.indexOf(0)' }, + { filename, code: 'function f(a: T) { a.indexOf(0) }' }, + { filename, code: 'function f(a: T) { a.indexOf(0) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].indexOf(0)', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.indexOf(0)', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.indexOf(0)', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.indexOf(0) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.indexOf(0) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.indexOf(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'indexOf(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.indexOf(0)' }, + { filename, code: 'let foo = {}; foo.indexOf(0)' }, + { filename, code: 'indexOf(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].indexOf(0)', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.indexOf(0)', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.indexOf(0)', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.indexOf(0) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.indexOf(0) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.indexOf(0) }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.indexOf(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-keys.ts b/tests/src/rules/no-array-prototype-keys.ts new file mode 100644 index 00000000..d63e20f0 --- /dev/null +++ b/tests/src/rules/no-array-prototype-keys.ts @@ -0,0 +1,110 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-keys'; + +const ruleId = 'no-array-prototype-keys'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.keys' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'keys()', + 'foo.reverse()', + 'foo.keys()', + { code: 'keys()', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.keys()', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.keys()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.keys()', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'keys()' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.keys()' }, + { filename, code: 'let foo = {}; foo.keys()' }, + { filename, code: 'keys()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.keys()' }, + { filename, code: 'let foo = Array(); foo.keys()' }, + { filename, code: 'function f(a: T) { a.keys() }' }, + { filename, code: 'function f(a: T) { a.keys() }' }, + ], + invalid: [ + { filename, code: '[a, b, c].keys()', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.keys()', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.keys()', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.keys() }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.keys() }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.keys()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'keys()' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.keys()' }, + { filename, code: 'let foo = {}; foo.keys()' }, + { filename, code: 'keys()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].keys()', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.keys()', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.keys()', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.keys() }', errors: [{ ...error, column: 37 }] }, + { filename, code: 'function f(a: T) { a.keys() }', errors: [{ ...error, column: 46 }] }, + { + filename, + code: 'function f(a: T) { a.keys() }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.keys()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-lastindexof.ts b/tests/src/rules/no-array-prototype-lastindexof.ts new file mode 100644 index 00000000..16cd3a94 --- /dev/null +++ b/tests/src/rules/no-array-prototype-lastindexof.ts @@ -0,0 +1,114 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-lastindexof'; + +const ruleId = 'no-array-prototype-lastindexof'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.lastIndexOf' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'lastIndexOf(0)', + 'foo.reverse()', + 'foo.lastIndexOf(0)', + { code: 'lastIndexOf(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.lastIndexOf(0)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.lastIndexOf(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.lastIndexOf(0)', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'lastIndexOf(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.lastIndexOf(0)' }, + { filename, code: 'let foo = {}; foo.lastIndexOf(0)' }, + { filename, code: 'lastIndexOf(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.lastIndexOf(0)' }, + { filename, code: 'let foo = Array(); foo.lastIndexOf(0)' }, + { filename, code: 'function f(a: T) { a.lastIndexOf(0) }' }, + { filename, code: 'function f(a: T) { a.lastIndexOf(0) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].lastIndexOf(0)', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.lastIndexOf(0)', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.lastIndexOf(0)', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.lastIndexOf(0) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.lastIndexOf(0) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.lastIndexOf(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'lastIndexOf(0)' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.lastIndexOf(0)' }, + { filename, code: 'let foo = {}; foo.lastIndexOf(0)' }, + { filename, code: 'lastIndexOf(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].lastIndexOf(0)', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.lastIndexOf(0)', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.lastIndexOf(0)', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.lastIndexOf(0) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.lastIndexOf(0) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.lastIndexOf(0) }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.lastIndexOf(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-map.ts b/tests/src/rules/no-array-prototype-map.ts new file mode 100644 index 00000000..525b2824 --- /dev/null +++ b/tests/src/rules/no-array-prototype-map.ts @@ -0,0 +1,114 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-map'; + +const ruleId = 'no-array-prototype-map'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.map' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'map(() => {})', + 'foo.reverse()', + 'foo.map(() => {})', + { code: 'map(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.map(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.map(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.map(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'map(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.map(() => {})' }, + { filename, code: 'let foo = {}; foo.map(() => {})' }, + { filename, code: 'map(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.map(() => {})' }, + { filename, code: 'let foo = Array(); foo.map(() => {})' }, + { filename, code: 'function f(a: T) { a.map(() => {}) }' }, + { filename, code: 'function f(a: T) { a.map(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].map(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.map(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.map(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.map(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.map(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.map(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'map(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.map(() => {})' }, + { filename, code: 'let foo = {}; foo.map(() => {})' }, + { filename, code: 'map(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].map(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.map(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.map(() => {})', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.map(() => {}) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.map(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.map(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.map(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-reduce.ts b/tests/src/rules/no-array-prototype-reduce.ts new file mode 100644 index 00000000..9714ff5d --- /dev/null +++ b/tests/src/rules/no-array-prototype-reduce.ts @@ -0,0 +1,124 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-reduce'; + +const ruleId = 'no-array-prototype-reduce'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.reduce' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'reduce(() => {})', + 'foo.reverse()', + 'foo.reduce(() => {})', + { code: 'reduce(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.reduce(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.reduce(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.reduce(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'reduce(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.reduce(() => {})' }, + { filename, code: 'let foo = {}; foo.reduce(() => {})' }, + { filename, code: 'reduce(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.reduce(() => {})' }, + { filename, code: 'let foo = Array(); foo.reduce(() => {})' }, + { filename, code: 'function f(a: T) { a.reduce(() => {}) }' }, + { filename, code: 'function f(a: T) { a.reduce(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].reduce(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.reduce(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.reduce(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.reduce(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.reduce(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'foo.reduce(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'reduce(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.reduce(() => {})' }, + { filename, code: 'let foo = {}; foo.reduce(() => {})' }, + { filename, code: 'reduce(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].reduce(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.reduce(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.reduce(() => {})', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.reduce(() => {}) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.reduce(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.reduce(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { + filename, + code: 'foo.reduce(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-reduceright.ts b/tests/src/rules/no-array-prototype-reduceright.ts new file mode 100644 index 00000000..4a4280d0 --- /dev/null +++ b/tests/src/rules/no-array-prototype-reduceright.ts @@ -0,0 +1,128 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-reduceright'; + +const ruleId = 'no-array-prototype-reduceright'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.reduceRight' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'reduceRight(() => {})', + 'foo.reverse()', + 'foo.reduceRight(() => {})', + { code: 'reduceRight(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.reduceRight(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.reduceRight(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.reduceRight(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'reduceRight(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.reduceRight(() => {})' }, + { filename, code: 'let foo = {}; foo.reduceRight(() => {})' }, + { filename, code: 'reduceRight(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.reduceRight(() => {})' }, + { filename, code: 'let foo = Array(); foo.reduceRight(() => {})' }, + { filename, code: 'function f(a: T) { a.reduceRight(() => {}) }' }, + { filename, code: 'function f(a: T) { a.reduceRight(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].reduceRight(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.reduceRight(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.reduceRight(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.reduceRight(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.reduceRight(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'foo.reduceRight(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'reduceRight(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.reduceRight(() => {})' }, + { filename, code: 'let foo = {}; foo.reduceRight(() => {})' }, + { filename, code: 'reduceRight(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].reduceRight(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.reduceRight(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.reduceRight(() => {})', errors: [{ ...error, column: 20 }] }, + { + filename, + code: 'function f(a: T) { a.reduceRight(() => {}) }', + errors: [{ ...error, column: 37 }], + }, + { + filename, + code: 'function f(a: T) { a.reduceRight(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.reduceRight(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { + filename, + code: 'foo.reduceRight(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-some.ts b/tests/src/rules/no-array-prototype-some.ts new file mode 100644 index 00000000..55058bc2 --- /dev/null +++ b/tests/src/rules/no-array-prototype-some.ts @@ -0,0 +1,114 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-some'; + +const ruleId = 'no-array-prototype-some'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.some' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'some(() => {})', + 'foo.reverse()', + 'foo.some(() => {})', + { code: 'some(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.some(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.some(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.some(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'some(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.some(() => {})' }, + { filename, code: 'let foo = {}; foo.some(() => {})' }, + { filename, code: 'some(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.some(() => {})' }, + { filename, code: 'let foo = Array(); foo.some(() => {})' }, + { filename, code: 'function f(a: T) { a.some(() => {}) }' }, + { filename, code: 'function f(a: T) { a.some(() => {}) }' }, + ], + invalid: [ + { filename, code: '[a, b, c].some(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.some(() => {})', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.some(() => {})', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.some(() => {}) }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.some(() => {}) }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.some(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'some(() => {})' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.some(() => {})' }, + { filename, code: 'let foo = {}; foo.some(() => {})' }, + { filename, code: 'some(() => {})', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].some(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.some(() => {})', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.some(() => {})', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.some(() => {}) }', errors: [{ ...error, column: 37 }] }, + { + filename, + code: 'function f(a: T) { a.some(() => {}) }', + errors: [{ ...error, column: 46 }], + }, + { + filename, + code: 'function f(a: T) { a.some(() => {}) }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.some(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-array-prototype-values.ts b/tests/src/rules/no-array-prototype-values.ts new file mode 100644 index 00000000..50b9c368 --- /dev/null +++ b/tests/src/rules/no-array-prototype-values.ts @@ -0,0 +1,110 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-array-prototype-values'; + +const ruleId = 'no-array-prototype-values'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Array.prototype.values' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'values()', + 'foo.reverse()', + 'foo.values()', + { code: 'values()', settings: { es: { aggressive: true } } }, + { code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + { code: 'foo.values()', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.values()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.values()', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'values()' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.values()' }, + { filename, code: 'let foo = {}; foo.values()' }, + { filename, code: 'values()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + + // `Array` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = []; foo.values()' }, + { filename, code: 'let foo = Array(); foo.values()' }, + { filename, code: 'function f(a: T) { a.values() }' }, + { filename, code: 'function f(a: T) { a.values() }' }, + ], + invalid: [ + { filename, code: '[a, b, c].values()', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'let foo = []; foo.values()', + errors: [{ ...error, column: 15 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Array(); foo.values()', + errors: [{ ...error, column: 20 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.values() }', + errors: [{ ...error, column: 37 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'function f(a: T) { a.values() }', + errors: [{ ...error, column: 51 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.values()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'values()' }, + { filename, code: 'foo.reverse()' }, + { filename, code: 'foo.values()' }, + { filename, code: 'let foo = {}; foo.values()' }, + { filename, code: 'values()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.reverse()', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '[a, b, c].values()', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = []; foo.values()', errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = Array(); foo.values()', errors: [{ ...error, column: 20 }] }, + { filename, code: 'function f(a: T) { a.values() }', errors: [{ ...error, column: 37 }] }, + { filename, code: 'function f(a: T) { a.values() }', errors: [{ ...error, column: 46 }] }, + { + filename, + code: 'function f(a: T) { a.values() }', + errors: [{ ...error, column: 51 }], + }, + { filename, code: 'foo.values()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-arrow-functions.ts b/tests/src/rules/no-arrow-functions.ts new file mode 100644 index 00000000..961b3304 --- /dev/null +++ b/tests/src/rules/no-arrow-functions.ts @@ -0,0 +1,153 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-arrow-functions'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.ArrowFunctionExpression, data: {} }; + +new RuleTester().run('no-arrow-functions', rule, { + valid: ['function f() {}', 'const f = function() {}'], + invalid: [ + { code: '() => 1', output: '(function() { return 1 })', errors: [{ ...error, column: 1 }] }, + { code: '() => {}', output: '(function() {})', errors: [{ ...error, column: 1 }] }, + { + code: '() => this.data', + output: '(function() { return this.data }.bind(this))', + errors: [{ ...error, column: 1 }], + }, + { code: 'a => a', output: '(function(a) { return a })', errors: [{ ...error, column: 1 }] }, + { code: '(a, b) => a - b', output: '(function(a, b) { return a - b })', errors: [{ ...error, column: 1 }] }, + { + code: 'var fnRestParams = (param1, param2, ...rest) => { statements }', + output: 'var fnRestParams = function(param1, param2, ...rest) { statements }', + errors: [{ ...error, column: 20 }], + }, + { + code: 'var fnDefParams = (param1 = defaultValue1, param2, paramN = defaultValueN) => { statements }', + output: 'var fnDefParams = function(param1 = defaultValue1, param2, paramN = defaultValueN) { statements }', + errors: [{ ...error, column: 19 }], + }, + { + code: 'var fnDestructuring = ([a, b] = [1, 2], {x: c} = {x: a + b}) => a + b + c;', + output: 'var fnDestructuring = function([a, b] = [1, 2], {x: c} = {x: a + b}) { return a + b + c };', + errors: [{ ...error, column: 23 }], + }, + { + code: 'let square = n => ({ square: n * n });', + output: 'let square = function(n) { return ({ square: n * n }) };', + errors: [{ ...error, column: 14 }], + }, + { + code: ` +var comment1 = a => /*comment*/ a; +var comment2 = a => /* +comment +*/ a; +var comment3 = a => // comment +a; + `, + output: ` +var comment1 = function(a) { return /*comment*/ a }; +var comment2 = function(a) { return (/* +comment +*/ a) }; +var comment3 = function(a) { return (// comment +a) }; + `, + errors: [ + { ...error, line: 2, column: 16 }, + { ...error, line: 3, column: 16 }, + { ...error, line: 6, column: 16 }, + ], + }, + { + code: ` +var fnHasThis1 = () => { + proc(); + return function() {}.bind(this); +} +var fnHasThis2 = () => { + proc(); + this.proc() +} + `, + output: ` +var fnHasThis1 = function() { + proc(); + return function() {}.bind(this); +}.bind(this) +var fnHasThis2 = function() { + proc(); + this.proc() +}.bind(this) + `, + errors: [ + { ...error, line: 2, column: 18 }, + { ...error, line: 6, column: 18 }, + ], + }, + { + code: ` +class SubClass extends SuperClass { + + methodSub() { + const f = () => { + return super.methodSuper() + } + return f + } +} + `, + output: null, + errors: [{ ...error, line: 5, column: 19 }], + }, + { + code: ` +const f = () => { + return function () { + return this + } +} + `, + output: ` +const f = function() { + return function () { + return this + } +} + `, + errors: [{ ...error, line: 2, column: 11 }], + }, + { + code: ` +const f = () => { + return () => { + return this + } +} + `, + output: ` +const f = function() { + return () => { + return this + } +}.bind(this) + `, + errors: [ + { ...error, line: 2, column: 11 }, + { ...error, line: 3, column: 12 }, + ], + }, + { + code: ` +const f = () => + 777 + `, + output: ` +const f = function() { return (777) } + `, + errors: [{ ...error, line: 2, column: 11 }], + }, + { code: 'async () => {}', output: '(async function() {})', errors: [{ ...error, column: 1 }] }, + ], +}); diff --git a/tests/src/rules/no-async-functions.ts b/tests/src/rules/no-async-functions.ts new file mode 100644 index 00000000..3888da0a --- /dev/null +++ b/tests/src/rules/no-async-functions.ts @@ -0,0 +1,28 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-async-functions'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.FunctionExpression, data: {} }; + +new RuleTester().run('no-async-functions', rule, { + valid: [ + 'function f() {}', + 'const f = function() {}', + 'const f = () => {}', + '({ method() {} })', + 'class A { method() {} }', + '(class { method() {} })', + ], + invalid: [ + { code: 'async function f() {}', errors: [{ ...error, column: 1, type: AST_NODE_TYPES.FunctionDeclaration }] }, + { code: 'const f = async function() {}', errors: [{ ...error, column: 11 }] }, + { + code: 'const f = async () => {}', + errors: [{ ...error, column: 11, type: AST_NODE_TYPES.ArrowFunctionExpression }], + }, + { code: '({ async method() {} })', errors: [{ ...error, column: 16 }] }, + { code: 'class A { async method() {} }', errors: [{ ...error, column: 23 }] }, + { code: '(class { async method() {} })', errors: [{ ...error, column: 22 }] }, + ], +}); diff --git a/tests/src/rules/no-async-iteration.ts b/tests/src/rules/no-async-iteration.ts new file mode 100644 index 00000000..fe9554ec --- /dev/null +++ b/tests/src/rules/no-async-iteration.ts @@ -0,0 +1,56 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-async-iteration'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.FunctionExpression, data: {} }; + +new RuleTester().run('no-async-iteration', rule, { + valid: [ + 'async function f() {}', + 'const f = async function() {}', + 'const f = async () => {}', + '({ async method() {} })', + 'class A { async method() {} }', + '(class { async method() {} })', + 'for (const a of b);', + ], + invalid: [ + { + code: 'async function* f() {}', + errors: [{ ...error, column: 1, type: AST_NODE_TYPES.FunctionDeclaration }], + }, + { + code: 'const f = async function*() {}', + errors: [{ ...error, column: 11 }], + }, + { + code: '({ async* method() {} })', + errors: [{ ...error, column: 17 }], + }, + { + code: 'class A { async* method() {} }', + errors: [{ ...error, column: 24 }], + }, + { + code: '(class { async* method() {} })', + errors: [{ ...error, column: 23 }], + }, + { + code: 'async function f() { for await (a of b); }', + errors: [{ ...error, column: 22, type: AST_NODE_TYPES.ForOfStatement }], + }, + { + code: 'async function f() { for await (var a of b); }', + errors: [{ ...error, column: 22, type: AST_NODE_TYPES.ForOfStatement }], + }, + { + code: 'async function f() { for await (let a of b); }', + errors: [{ ...error, column: 22, type: AST_NODE_TYPES.ForOfStatement }], + }, + { + code: 'async function f() { for await (const a of b); }', + errors: [{ ...error, column: 22, type: AST_NODE_TYPES.ForOfStatement }], + }, + ], +}); diff --git a/tests/src/rules/no-atomics.ts b/tests/src/rules/no-atomics.ts new file mode 100644 index 00000000..3f250e66 --- /dev/null +++ b/tests/src/rules/no-atomics.ts @@ -0,0 +1,19 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-atomics'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.Identifier, + data: { name: 'Atomics' }, +}; + +new RuleTester().run('no-atomics', rule, { + valid: ['Array', 'Object', 'let Atomics = 0; Atomics'], + invalid: [ + { code: 'Atomics', errors: [{ ...error, column: 1 }] }, + { code: 'function f() { Atomics }', errors: [{ ...error, column: 16 }] }, + ], +}); diff --git a/tests/src/rules/no-bigint.ts b/tests/src/rules/no-bigint.ts new file mode 100644 index 00000000..ad1af228 --- /dev/null +++ b/tests/src/rules/no-bigint.ts @@ -0,0 +1,25 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-bigint'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Literal, data: {} }; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-bigint.'); +} else { + new RuleTester().run('no-bigint', rule, { + valid: ['100'], + invalid: [ + { code: '100n', errors: [{ ...error, column: 1 }] }, + { code: '({ 100n: null })', errors: [{ ...error, column: 4 }] }, + { code: '({ 100n() {} })', errors: [{ ...error, column: 4 }] }, + { code: '({ get 100n() {} })', errors: [{ ...error, column: 8 }] }, + { code: 'class A { 100n() {} }', errors: [{ ...error, column: 11 }] }, + { code: 'class A { get 100n() {} }', errors: [{ ...error, column: 15 }] }, + { code: 'BigInt', errors: [{ ...error, column: 1, type: AST_NODE_TYPES.Identifier }] }, + { code: 'BigInt64Array', errors: [{ ...error, column: 1, type: AST_NODE_TYPES.Identifier }] }, + { code: 'BigUint64Array', errors: [{ ...error, column: 1, type: AST_NODE_TYPES.Identifier }] }, + ], + }); +} diff --git a/tests/src/rules/no-binary-numeric-literals.ts b/tests/src/rules/no-binary-numeric-literals.ts new file mode 100644 index 00000000..a4c5e12d --- /dev/null +++ b/tests/src/rules/no-binary-numeric-literals.ts @@ -0,0 +1,14 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-binary-numeric-literals'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, type: AST_NODE_TYPES.Literal, data: {} }; + +new RuleTester().run('no-binary-numeric-literals', rule, { + valid: ['1', '1e10', '01', '0x1', '0o1', '0O1', "'0b01'", "'0B01'"], + invalid: [ + { code: '0b01', errors: [error] }, + { code: '0B01', errors: [error] }, + ], +}); diff --git a/tests/src/rules/no-block-scoped-functions.ts b/tests/src/rules/no-block-scoped-functions.ts new file mode 100644 index 00000000..565b41f7 --- /dev/null +++ b/tests/src/rules/no-block-scoped-functions.ts @@ -0,0 +1,28 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-block-scoped-functions'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.FunctionDeclaration, data: {} }; + +new RuleTester().run('no-block-scoped-functions', rule, { + valid: [ + 'function f() {}', + { code: 'function f() {}', parserOptions: { sourceType: 'module' } }, + 'function wrap() { function f() {} }', + '(function() { function f() {} })()', + '(() => { function f() {} })()', + '({ wrap() { function f() {} } })', + 'class A { wrap() { function f() {} } }', + '(class { wrap() { function f() {} } })', + '(() => function f() {})()', + 'if (a) { (function f() {}) }', + 'if (a) { (() => {}) }', + ], + invalid: [ + { code: '{ function f() {} }', errors: [{ ...error, column: 3 }] }, + { code: 'if (a) { function f() {} }', errors: [{ ...error, column: 10 }] }, + { code: 'if (a) ; else { function f() {} }', errors: [{ ...error, column: 17 }] }, + { code: 'function wrap() { if (a) { function f() {} } }', errors: [{ ...error, column: 28 }] }, + ], +}); diff --git a/tests/src/rules/no-block-scoped-variables.ts b/tests/src/rules/no-block-scoped-variables.ts new file mode 100644 index 00000000..74aeddca --- /dev/null +++ b/tests/src/rules/no-block-scoped-variables.ts @@ -0,0 +1,18 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-block-scoped-variables'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.VariableDeclaration, data: {} }; + +new RuleTester().run('no-block-scoped-variables', rule, { + valid: ['var a = 1', 'function f(a) {}', 'function f(a = 1) {}', 'try {} catch (e) {}'], + invalid: [ + { code: 'const a = 1', errors: [{ ...error, column: 1 }] }, + { code: 'let a = 1', errors: [{ ...error, column: 1 }] }, + { code: '{ const a = 1 }', errors: [{ ...error, column: 3 }] }, + { code: '{ let a = 1 }', errors: [{ ...error, column: 3 }] }, + { code: 'function wrap() { const a = 1 }', errors: [{ ...error, column: 19 }] }, + { code: 'function wrap() { let a = 1 }', errors: [{ ...error, column: 19 }] }, + ], +}); diff --git a/tests/src/rules/no-classes.ts b/tests/src/rules/no-classes.ts new file mode 100644 index 00000000..1de59a7a --- /dev/null +++ b/tests/src/rules/no-classes.ts @@ -0,0 +1,14 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-classes'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.ClassDeclaration, data: {} }; + +new RuleTester().run('no-classes', rule, { + valid: ['function A() {} A.prototype.foo = function() {}'], + invalid: [ + { code: 'class A {}', errors: [{ ...error, column: 1 }] }, + { code: '(class {})', errors: [{ ...error, column: 2, type: AST_NODE_TYPES.ClassExpression }] }, + ], +}); diff --git a/tests/src/rules/no-computed-properties.ts b/tests/src/rules/no-computed-properties.ts new file mode 100644 index 00000000..02b5ff25 --- /dev/null +++ b/tests/src/rules/no-computed-properties.ts @@ -0,0 +1,29 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-computed-properties'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Property, data: {} }; + +new RuleTester().run('no-computed-properties', rule, { + valid: ['({ foo: 1 })', '({ foo })', '({ foo() {} })'], + invalid: [ + { code: '({ [a]: 1 })', errors: [{ ...error, column: 4 }] }, + { code: '({ [a]() {} })', errors: [{ ...error, column: 4 }] }, + { code: '({ get [a]() {} })', errors: [{ ...error, column: 4 }] }, + { code: '({ set [a](value) {} })', errors: [{ ...error, column: 4 }] }, + { code: '({ [a]: b } = obj)', errors: [{ ...error, column: 4 }] }, + { code: 'function f({ [a]: b }) {}', errors: [{ ...error, column: 14 }] }, + { code: 'class A { [a]() {} }', errors: [{ ...error, column: 11, type: AST_NODE_TYPES.MethodDefinition }] }, + { code: 'class A { get [a]() {} }', errors: [{ ...error, column: 11, type: AST_NODE_TYPES.MethodDefinition }] }, + { code: 'class A { set [a](value) {} }', errors: [{ ...error, column: 11, type: AST_NODE_TYPES.MethodDefinition }] }, + { code: 'class A { static [a]() {} }', errors: [{ ...error, column: 11, type: AST_NODE_TYPES.MethodDefinition }] }, + { code: '(class A { [a]() {} })', errors: [{ ...error, column: 12, type: AST_NODE_TYPES.MethodDefinition }] }, + { code: '(class A { get [a]() {} })', errors: [{ ...error, column: 12, type: AST_NODE_TYPES.MethodDefinition }] }, + { + code: '(class A { set [a](value) {} })', + errors: [{ ...error, column: 12, type: AST_NODE_TYPES.MethodDefinition }], + }, + { code: '(class A { static [a]() {} })', errors: [{ ...error, column: 12, type: AST_NODE_TYPES.MethodDefinition }] }, + ], +}); diff --git a/tests/src/rules/no-date-now.ts b/tests/src/rules/no-date-now.ts new file mode 100644 index 00000000..936e3f3c --- /dev/null +++ b/tests/src/rules/no-date-now.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-date-now'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Date.now' }, +}; + +new RuleTester().run('no-date-now', rule, { + valid: ['Date', 'Date.parse', 'let Date = 0; Date.now'], + invalid: [{ code: 'Date.now', errors: [error] }], +}); diff --git a/tests/src/rules/no-default-parameters.ts b/tests/src/rules/no-default-parameters.ts new file mode 100644 index 00000000..89f08ea4 --- /dev/null +++ b/tests/src/rules/no-default-parameters.ts @@ -0,0 +1,34 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-default-parameters'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.AssignmentPattern, data: {} }; + +new RuleTester().run('no-default-parameters', rule, { + valid: [ + 'function f(a, ...rest) {}', + 'const f = function(a, ...rest) {}', + 'const f = (a, ...rest) => {}', + '({ method(a, ...rest) {} })', + 'class A { method(a, ...rest) {} }', + '(class { method(a, ...rest) {} })', + 'var a = 1', + 'var {a = 0} = obj', + 'var [a = 0] = ary', + '({a = 0} = obj)', + '([a = 0] = ary)', + 'function f({a = 0}) {}', + 'function f([a = 0]) {}', + ], + invalid: [ + { code: 'async function f(a = 0) {}', errors: [{ ...error, column: 18 }] }, + { code: 'const f = async function(a = 0) {}', errors: [{ ...error, column: 26 }] }, + { code: 'const f = async (a = 0) => {}', errors: [{ ...error, column: 18 }] }, + { code: '({ async method(a = 0) {} })', errors: [{ ...error, column: 17 }] }, + { code: 'class A { async method(a = 0) {} }', errors: [{ ...error, column: 24 }] }, + { code: '(class { async method(a = 0) {} })', errors: [{ ...error, column: 23 }] }, + { code: 'async function f({a} = 0) {}', errors: [{ ...error, column: 18 }] }, + { code: 'async function f([a] = 0) {}', errors: [{ ...error, column: 18 }] }, + ], +}); diff --git a/tests/src/rules/no-destructuring.ts b/tests/src/rules/no-destructuring.ts new file mode 100644 index 00000000..e1a2a8a1 --- /dev/null +++ b/tests/src/rules/no-destructuring.ts @@ -0,0 +1,32 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-destructuring'; + +const baseError = { messageId: 'forbidden' as const, line: 1, data: {} }; +const arrayError = { ...baseError, type: AST_NODE_TYPES.ArrayPattern }; +const objectError = { ...baseError, type: AST_NODE_TYPES.ObjectPattern }; + +new RuleTester().run('no-destructuring', rule, { + valid: ['({})', '({a: 1})', '[]', '[1]', 'var a = {a}'], + invalid: [ + { code: 'var [a, {b: []}, [c], [d] = ary1, ...e] = ary2', errors: [{ ...arrayError, column: 5 }] }, + { code: 'let [a, {b: []}, [c], [d] = ary1, ...e] = ary2', errors: [{ ...arrayError, column: 5 }] }, + { code: 'const [a, {b: []}, [c], [d] = ary1, ...e] = ary2', errors: [{ ...arrayError, column: 7 }] }, + { code: '([a, {b: []}, [c], [d] = ary1, ...e] = ary2)', errors: [{ ...arrayError, column: 2 }] }, + { code: 'for ([a, {b: []}, [c], [d] = ary1, ...e] in ary2);', errors: [{ ...arrayError, column: 6 }] }, + { code: 'for ([a, {b: []}, [c], [d] = ary1, ...e] of ary2);', errors: [{ ...arrayError, column: 6 }] }, + { code: 'function f([a, {b: []}, [c], [d] = ary1, ...e]) {}', errors: [{ ...arrayError, column: 12 }] }, + { code: 'function f([a, {b: []}, [c], [d] = ary1, ...e] = ary2) {}', errors: [{ ...arrayError, column: 12 }] }, + { code: 'function f(...[a, {b: []}, [c], [d] = ary1, ...e]) {}', errors: [{ ...arrayError, column: 15 }] }, + { code: 'var { a: {b}, c: [d, {e}, ...f], ...g} = obj', errors: [{ ...objectError, column: 5 }] }, + { code: 'let { a: {b}, c: [d, {e}, ...f], ...g} = obj', errors: [{ ...objectError, column: 5 }] }, + { code: 'const { a: {b}, c: [d, {e}, ...f], ...g} = obj', errors: [{ ...objectError, column: 7 }] }, + { code: '({ a: {b}, c: [d, {e}, ...f], ...g} = obj)', errors: [{ ...objectError, column: 2 }] }, + { code: 'for ({ a: {b}, c: [d, {e}, ...f], ...g} in obj);', errors: [{ ...objectError, column: 6 }] }, + { code: 'for ({ a: {b}, c: [d, {e}, ...f], ...g} of obj);', errors: [{ ...objectError, column: 6 }] }, + { code: 'function f({ a: {b}, c: [d, {e}, ...f], ...g}) {}', errors: [{ ...objectError, column: 12 }] }, + { code: 'function f({ a: {b}, c: [d, {e}, ...f], ...g} = obj) {}', errors: [{ ...objectError, column: 12 }] }, + { code: 'function f(...{ a: {b}, c: [d, {e}, ...f], ...g}) {}', errors: [{ ...objectError, column: 15 }] }, + ], +}); diff --git a/tests/src/rules/no-dynamic-import.ts b/tests/src/rules/no-dynamic-import.ts new file mode 100644 index 00000000..4eb634e8 --- /dev/null +++ b/tests/src/rules/no-dynamic-import.ts @@ -0,0 +1,15 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-dynamic-import'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, type: AST_NODE_TYPES.ImportExpression, data: {} }; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-dynamic-import.'); +} else { + new RuleTester().run('no-dynamic-import', rule, { + valid: [{ code: "import a from 'a'", parserOptions: { sourceType: 'module' } }, 'obj.\nimport(source)'], + invalid: [{ code: 'import(source)', errors: [error] }], + }); +} diff --git a/tests/src/rules/no-exponential-operators.ts b/tests/src/rules/no-exponential-operators.ts new file mode 100644 index 00000000..4a70ac2c --- /dev/null +++ b/tests/src/rules/no-exponential-operators.ts @@ -0,0 +1,20 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-exponential-operators'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, data: {} }; + +new RuleTester().run('no-exponential-operators', rule, { + valid: ['a*b', 'a*=b'], + invalid: [ + { + code: 'a**b', + errors: [{ ...error, type: AST_NODE_TYPES.BinaryExpression }], + }, + { + code: 'a**=b', + errors: [{ ...error, type: AST_NODE_TYPES.AssignmentExpression }], + }, + ], +}); diff --git a/tests/src/rules/no-export-ns-from.ts b/tests/src/rules/no-export-ns-from.ts new file mode 100644 index 00000000..fe8a66ef --- /dev/null +++ b/tests/src/rules/no-export-ns-from.ts @@ -0,0 +1,33 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-export-ns-from'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.ExportAllDeclaration, + data: {}, +}; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-export-ns-from.'); +} else { + new RuleTester({ + parserOptions: { sourceType: 'module' }, + } as TSESLint.RuleTesterConfig).run('no-export-ns-from', rule, { + valid: [ + 'export * from "mod"', + 'export default foo', + 'export {foo} from "mod"', + 'export {foo as bar} from "mod"', + 'import * as foo from "mod"', + 'import foo from "mod"', + 'import {foo} from "mod"', + 'import {foo as bar} from "mod"', + ], + invalid: [{ code: 'export * as ns from "mod"', errors: [error] }], + }); +} diff --git a/tests/src/rules/no-for-of-loops.ts b/tests/src/rules/no-for-of-loops.ts new file mode 100644 index 00000000..50917bd9 --- /dev/null +++ b/tests/src/rules/no-for-of-loops.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-for-of-loops'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.ForOfStatement, data: {} }; + +new RuleTester().run('no-for-of-loops', rule, { + valid: ['for(;;);', 'for(a in b);', 'for(var a in b);', 'for(let a in b);', 'for(const a in b);'], + invalid: [ + { code: 'for(a of b);', errors: [{ ...error, column: 1 }] }, + { code: 'for(var a of b);', errors: [{ ...error, column: 1 }] }, + { code: 'for(let a of b);', errors: [{ ...error, column: 1 }] }, + { code: 'for(const a of b);', errors: [{ ...error, column: 1 }] }, + { code: 'async function f() { for await (const a of b); }', errors: [{ ...error, column: 22 }] }, + ], +}); diff --git a/tests/src/rules/no-generators.ts b/tests/src/rules/no-generators.ts new file mode 100644 index 00000000..3b7d78f0 --- /dev/null +++ b/tests/src/rules/no-generators.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-generators'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.FunctionExpression, data: {} }; + +new RuleTester().run('no-generators', rule, { + valid: ['function f() {}', 'yield = 0'], + invalid: [ + { code: 'function* f() {}', errors: [{ ...error, column: 1, type: AST_NODE_TYPES.FunctionDeclaration }] }, + { code: '(function*() {})', errors: [{ ...error, column: 2 }] }, + { code: '({ *f() {} })', errors: [{ ...error, column: 6 }] }, + { code: 'class A { *f() {} }', errors: [{ ...error, column: 13 }] }, + { code: 'class A { static *f() {} }', errors: [{ ...error, column: 20 }] }, + ], +}); diff --git a/tests/src/rules/no-global-this.ts b/tests/src/rules/no-global-this.ts new file mode 100644 index 00000000..9c836052 --- /dev/null +++ b/tests/src/rules/no-global-this.ts @@ -0,0 +1,22 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-global-this'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, data: { name: 'globalThis' } }; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-global-this.'); +} else { + new RuleTester().run('no-global-this', rule, { + valid: ['window', 'global', 'self', '{ let globalThis = 0; globalThis }'], + invalid: [ + { code: 'globalThis', errors: [{ ...error, type: AST_NODE_TYPES.Identifier }] }, + { + code: 'window.globalThis', + globals: { window: 'readonly' }, + errors: [{ ...error, type: AST_NODE_TYPES.MemberExpression }], + }, + ], + }); +} diff --git a/tests/src/rules/no-import-meta.ts b/tests/src/rules/no-import-meta.ts new file mode 100644 index 00000000..d96287bc --- /dev/null +++ b/tests/src/rules/no-import-meta.ts @@ -0,0 +1,18 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-import-meta'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, type: AST_NODE_TYPES.MetaProperty, data: {} }; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-import-meta.'); +} else { + new RuleTester({ + parserOptions: { sourceType: 'module' }, + } as TSESLint.RuleTesterConfig).run('no-import-meta', rule, { + valid: ["import * as Foo from 'foo'", "import('foo')"], + invalid: [{ code: 'import.meta', errors: [error] }], + }); +} diff --git a/tests/src/rules/no-json-superset.ts b/tests/src/rules/no-json-superset.ts new file mode 100644 index 00000000..1905f0c2 --- /dev/null +++ b/tests/src/rules/no-json-superset.ts @@ -0,0 +1,32 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-json-superset'; + +const error = (code: number): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: AST_NODE_TYPES.Literal, + data: { code }, +}); + +if (!RuleTester.isSupported(2019)) { + console.log('Skip the tests of no-json-superset.'); +} else { + new RuleTester().run('no-json-superset', rule, { + valid: ['let a = null', "let a = '\\u2028'", "let a = '\\u2029'", "let a = '\\\u2028'", "let a = '\\\u2029'"], + invalid: [ + { code: "let a = '\u2028'", output: "let a = '\\u2028'", errors: [{ ...error(2028), column: 10 }] }, + { code: "let a = '\u2029'", output: "let a = '\\u2029'", errors: [{ ...error(2029), column: 10 }] }, + { + code: "let a = '\u2028 and \u2029'", + output: "let a = '\\u2028 and \\u2029'", + errors: [ + { ...error(2028), column: 10 }, + { ...error(2029), line: 2, column: 6 }, + ], + }, + ], + }); +} diff --git a/tests/src/rules/no-json.ts b/tests/src/rules/no-json.ts new file mode 100644 index 00000000..a96d3594 --- /dev/null +++ b/tests/src/rules/no-json.ts @@ -0,0 +1,21 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-json'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.Identifier, + data: { name: 'JSON' }, +}; + +new RuleTester().run('no-json', rule, { + valid: ['let JSON = 0; JSON'], + invalid: [ + { code: 'JSON', errors: [error] }, + { code: 'JSON.parse', errors: [error] }, + { code: 'JSON.stringify', errors: [error] }, + ], +}); diff --git a/tests/src/rules/no-keyword-properties.ts b/tests/src/rules/no-keyword-properties.ts new file mode 100644 index 00000000..f77c1112 --- /dev/null +++ b/tests/src/rules/no-keyword-properties.ts @@ -0,0 +1,18 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-keyword-properties'; + +const baseError = { messageId: 'forbidden' as const, line: 1, data: {} }; +const propertyError = { ...baseError, column: 4, type: AST_NODE_TYPES.Property }; +const memberError = { ...baseError, column: 1, type: AST_NODE_TYPES.MemberExpression }; + +new RuleTester().run('no-keyword-properties', rule, { + valid: ['({ a, b, c}.a)', '({ let: 1, of: 2}.let)', "({ 'if': 1 }['if'])"], + invalid: [ + { code: '({ if: 1 })', errors: [propertyError] }, + { code: '({ static: 2 })', errors: [propertyError] }, + { code: 'obj.if', errors: [memberError] }, + { code: 'obj.class', errors: [memberError] }, + ], +}); diff --git a/tests/src/rules/no-logical-assignment-operators.ts b/tests/src/rules/no-logical-assignment-operators.ts new file mode 100644 index 00000000..6faa7bb9 --- /dev/null +++ b/tests/src/rules/no-logical-assignment-operators.ts @@ -0,0 +1,22 @@ +import { AST_TOKEN_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-logical-assignment-operators'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_TOKEN_TYPES.Punctuator, data: {} }; + +if (!RuleTester.isSupported(2021)) { + console.log('Skip the tests of no-logical-assignment-operators.'); +} else { + new RuleTester().run('no-logical-assignment-operators', rule, { + valid: ['x = x || y', 'x = x && y', 'x = x ?? y', 'x += y', 'x -= y', 'x **= y'], + invalid: [ + { code: 'x ||= y', output: 'x = x || (y)', errors: [{ ...error, column: 3 }] }, + { code: 'x &&= y', output: 'x = x && (y)', errors: [{ ...error, column: 3 }] }, + { code: 'x ??= y', output: 'x = x ?? (y)', errors: [{ ...error, column: 3 }] }, + { code: 'a.b ||= c', output: null, errors: [{ ...error, column: 5 }] }, + { code: 'a().b ||= c', output: null, errors: [{ ...error, column: 7 }] }, + { code: 'a &&= (c + d)', output: 'a = a && (c + d)', errors: [{ ...error, column: 3 }] }, + ], + }); +} diff --git a/tests/src/rules/no-malformed-template-literals.ts b/tests/src/rules/no-malformed-template-literals.ts new file mode 100644 index 00000000..33859999 --- /dev/null +++ b/tests/src/rules/no-malformed-template-literals.ts @@ -0,0 +1,15 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-malformed-template-literals'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 4, type: AST_NODE_TYPES.TemplateLiteral, data: {} }; + +new RuleTester().run('no-malformed-template-literals', rule, { + valid: ['`foo`', 'tag`foo`', 'tag``'], + invalid: [ + { code: 'tag`\\unicode`', errors: [error] }, + // eslint-disable-next-line no-template-curly-in-string + { code: 'tag`\\unicode${a}\\unicode${b}\\unicode${c}unicode`', errors: [error] }, + ], +}); diff --git a/tests/src/rules/no-map.ts b/tests/src/rules/no-map.ts new file mode 100644 index 00000000..38a71329 --- /dev/null +++ b/tests/src/rules/no-map.ts @@ -0,0 +1,20 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-map'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Identifier, data: { name: 'Map' } }; + +new RuleTester().run('no-map', rule, { + valid: ['Array', 'Object', 'let Map = 0; Map'], + invalid: [ + { + code: 'Map', + errors: [{ ...error, column: 1 }], + }, + { + code: 'function f() { Map }', + errors: [{ ...error, column: 16 }], + }, + ], +}); diff --git a/tests/src/rules/no-math-acosh.ts b/tests/src/rules/no-math-acosh.ts new file mode 100644 index 00000000..ed80f243 --- /dev/null +++ b/tests/src/rules/no-math-acosh.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-acosh'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.acosh' }, +}; + +new RuleTester().run('no-math-acosh', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.acosh'], + invalid: [{ code: 'Math.acosh', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-asinh.ts b/tests/src/rules/no-math-asinh.ts new file mode 100644 index 00000000..b24e968e --- /dev/null +++ b/tests/src/rules/no-math-asinh.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-asinh'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.asinh' }, +}; + +new RuleTester().run('no-math-asinh', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.asinh'], + invalid: [{ code: 'Math.asinh', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-atanh.ts b/tests/src/rules/no-math-atanh.ts new file mode 100644 index 00000000..5707ce26 --- /dev/null +++ b/tests/src/rules/no-math-atanh.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-atanh'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.atanh' }, +}; + +new RuleTester().run('no-math-atanh', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.atanh'], + invalid: [{ code: 'Math.atanh', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-cbrt.ts b/tests/src/rules/no-math-cbrt.ts new file mode 100644 index 00000000..0309d09f --- /dev/null +++ b/tests/src/rules/no-math-cbrt.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-cbrt'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.cbrt' }, +}; + +new RuleTester().run('no-math-cbrt', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.cbrt'], + invalid: [{ code: 'Math.cbrt', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-clz32.ts b/tests/src/rules/no-math-clz32.ts new file mode 100644 index 00000000..f58cb079 --- /dev/null +++ b/tests/src/rules/no-math-clz32.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-clz32'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.clz32' }, +}; + +new RuleTester().run('no-math-clz32', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.clz32'], + invalid: [{ code: 'Math.clz32', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-cosh.ts b/tests/src/rules/no-math-cosh.ts new file mode 100644 index 00000000..105da338 --- /dev/null +++ b/tests/src/rules/no-math-cosh.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-cosh'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.cosh' }, +}; + +new RuleTester().run('no-math-cosh', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.cosh'], + invalid: [{ code: 'Math.cosh', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-expm1.ts b/tests/src/rules/no-math-expm1.ts new file mode 100644 index 00000000..28dfa100 --- /dev/null +++ b/tests/src/rules/no-math-expm1.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-expm1'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.expm1' }, +}; + +new RuleTester().run('no-math-expm1', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.expm1'], + invalid: [{ code: 'Math.expm1', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-fround.ts b/tests/src/rules/no-math-fround.ts new file mode 100644 index 00000000..6c86e74e --- /dev/null +++ b/tests/src/rules/no-math-fround.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-fround'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.fround' }, +}; + +new RuleTester().run('no-math-fround', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.fround'], + invalid: [{ code: 'Math.fround', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-hypot.ts b/tests/src/rules/no-math-hypot.ts new file mode 100644 index 00000000..fef643dc --- /dev/null +++ b/tests/src/rules/no-math-hypot.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-hypot'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.hypot' }, +}; + +new RuleTester().run('no-math-hypot', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.hypot'], + invalid: [{ code: 'Math.hypot', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-imul.ts b/tests/src/rules/no-math-imul.ts new file mode 100644 index 00000000..78b31f72 --- /dev/null +++ b/tests/src/rules/no-math-imul.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-imul'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.imul' }, +}; + +new RuleTester().run('no-math-imul', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.imul'], + invalid: [{ code: 'Math.imul', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-log10.ts b/tests/src/rules/no-math-log10.ts new file mode 100644 index 00000000..5b665542 --- /dev/null +++ b/tests/src/rules/no-math-log10.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-log10'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.log10' }, +}; + +new RuleTester().run('no-math-log10', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.log10'], + invalid: [{ code: 'Math.log10', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-log1p.ts b/tests/src/rules/no-math-log1p.ts new file mode 100644 index 00000000..77973cb2 --- /dev/null +++ b/tests/src/rules/no-math-log1p.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-log1p'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.log1p' }, +}; + +new RuleTester().run('no-math-log1p', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.log1p'], + invalid: [{ code: 'Math.log1p', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-log2.ts b/tests/src/rules/no-math-log2.ts new file mode 100644 index 00000000..80c93925 --- /dev/null +++ b/tests/src/rules/no-math-log2.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-log2'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.log2' }, +}; + +new RuleTester().run('no-math-log2', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.log2'], + invalid: [{ code: 'Math.log2', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-sign.ts b/tests/src/rules/no-math-sign.ts new file mode 100644 index 00000000..df37bab0 --- /dev/null +++ b/tests/src/rules/no-math-sign.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-sign'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.sign' }, +}; + +new RuleTester().run('no-math-sign', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.sign'], + invalid: [{ code: 'Math.sign', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-sinh.ts b/tests/src/rules/no-math-sinh.ts new file mode 100644 index 00000000..11eb521e --- /dev/null +++ b/tests/src/rules/no-math-sinh.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-sinh'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.sinh' }, +}; + +new RuleTester().run('no-math-sinh', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.sinh'], + invalid: [{ code: 'Math.sinh', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-tanh.ts b/tests/src/rules/no-math-tanh.ts new file mode 100644 index 00000000..77f417f3 --- /dev/null +++ b/tests/src/rules/no-math-tanh.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-tanh'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.tanh' }, +}; + +new RuleTester().run('no-math-tanh', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.tanh'], + invalid: [{ code: 'Math.tanh', errors: [error] }], +}); diff --git a/tests/src/rules/no-math-trunc.ts b/tests/src/rules/no-math-trunc.ts new file mode 100644 index 00000000..f77156fd --- /dev/null +++ b/tests/src/rules/no-math-trunc.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-math-trunc'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Math.trunc' }, +}; + +new RuleTester().run('no-math-trunc', rule, { + valid: ['Math', 'Math.min', 'Math.max', 'let Math = 0; Math.trunc'], + invalid: [{ code: 'Math.trunc', errors: [error] }], +}); diff --git a/tests/src/rules/no-modules.ts b/tests/src/rules/no-modules.ts new file mode 100644 index 00000000..c6110e3b --- /dev/null +++ b/tests/src/rules/no-modules.ts @@ -0,0 +1,28 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-modules'; + +const baseError = { messageId: 'forbidden' as const, line: 1, column: 1, data: {} }; +const importError = { ...baseError, type: AST_NODE_TYPES.ImportDeclaration }; +const exportNamedError = { ...baseError, type: AST_NODE_TYPES.ExportNamedDeclaration }; +const exportDefaultError = { ...baseError, type: AST_NODE_TYPES.ExportDefaultDeclaration }; + +new RuleTester({ + parserOptions: { sourceType: 'module' }, +} as TSESLint.RuleTesterConfig).run('no-modules', rule, { + valid: ['module.exports = {}', "require('x')"], + invalid: [ + { code: "import x from 'x'", errors: [importError] }, + { code: "import * as x from 'x'", errors: [importError] }, + { code: "import x, {y, z} from 'x'", errors: [importError] }, + { code: "export {x} from 'x'", errors: [exportNamedError] }, + { code: 'const x = 0; export {x}', errors: [{ ...exportNamedError, column: 14 }] }, + { code: 'export const a = 0', errors: [exportNamedError] }, + { code: 'export function f() {}', errors: [exportNamedError] }, + { code: 'export class A {}', errors: [exportNamedError] }, + { code: 'export default 0', errors: [exportDefaultError] }, + { code: 'export default function() {}', errors: [exportDefaultError] }, + ], +}); diff --git a/tests/src/rules/no-new-target.ts b/tests/src/rules/no-new-target.ts new file mode 100644 index 00000000..58c66503 --- /dev/null +++ b/tests/src/rules/no-new-target.ts @@ -0,0 +1,11 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-new-target'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 27, type: AST_NODE_TYPES.MetaProperty, data: {} }; + +new RuleTester().run('no-new-target', rule, { + valid: ['new F()', 'target = 1'], + invalid: [{ code: 'class A { constructor() { new.target } }', errors: [error] }], +}); diff --git a/tests/src/rules/no-nullish-coalescing-operators.ts b/tests/src/rules/no-nullish-coalescing-operators.ts new file mode 100644 index 00000000..44fb4a10 --- /dev/null +++ b/tests/src/rules/no-nullish-coalescing-operators.ts @@ -0,0 +1,38 @@ +import { AST_TOKEN_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-nullish-coalescing-operators'; + +const type = AST_TOKEN_TYPES.Punctuator; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-nullish-coalescing-operators.'); +} else { + new RuleTester().run('no-nullish-coalescing-operators', rule, { + valid: ['a ? b : c', 'a && b', 'a || b'], + invalid: [ + { code: 'a??b', errors: [{ messageId: 'forbidden', type, line: 1, column: 2, endColumn: 4 }] }, + { + code: ` /* ?? comment ?? */ + a /* ?? comment ?? */ + ?? /* ?? comment ?? */ + b /* ?? comment ?? */`, + errors: [{ messageId: 'forbidden', type, line: 3, column: 13, endLine: 3, endColumn: 15 }], + }, + { + code: 'a ?? b ?? c', + errors: [ + { messageId: 'forbidden', type, line: 1, column: 3, endColumn: 5 }, + { messageId: 'forbidden', type, line: 1, column: 8, endColumn: 10 }, + ], + }, + { + code: '(a ?? b) ?? c', + errors: [ + { messageId: 'forbidden', type, line: 1, column: 4, endColumn: 6 }, + { messageId: 'forbidden', type, line: 1, column: 10, endColumn: 12 }, + ], + }, + ], + }); +} diff --git a/tests/src/rules/no-number-epsilon.ts b/tests/src/rules/no-number-epsilon.ts new file mode 100644 index 00000000..d6adc7ae --- /dev/null +++ b/tests/src/rules/no-number-epsilon.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-epsilon'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.EPSILON' }, +}; + +new RuleTester().run('no-number-epsilon', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.EPSILON'], + invalid: [{ code: 'Number.EPSILON', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-isfinite.ts b/tests/src/rules/no-number-isfinite.ts new file mode 100644 index 00000000..baf9af90 --- /dev/null +++ b/tests/src/rules/no-number-isfinite.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-isfinite'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.isFinite' }, +}; + +new RuleTester().run('no-number-isfinite', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.isFinite'], + invalid: [{ code: 'Number.isFinite', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-isinteger.ts b/tests/src/rules/no-number-isinteger.ts new file mode 100644 index 00000000..07ba2be7 --- /dev/null +++ b/tests/src/rules/no-number-isinteger.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-isinteger'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.isInteger' }, +}; + +new RuleTester().run('no-number-isinteger', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.isInteger'], + invalid: [{ code: 'Number.isInteger', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-isnan.ts b/tests/src/rules/no-number-isnan.ts new file mode 100644 index 00000000..ff78bef3 --- /dev/null +++ b/tests/src/rules/no-number-isnan.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-isnan'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.isNaN' }, +}; + +new RuleTester().run('no-number-isnan', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.isNaN'], + invalid: [{ code: 'Number.isNaN', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-issafeinteger.ts b/tests/src/rules/no-number-issafeinteger.ts new file mode 100644 index 00000000..34fa0344 --- /dev/null +++ b/tests/src/rules/no-number-issafeinteger.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-issafeinteger'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.isSafeInteger' }, +}; + +new RuleTester().run('no-number-issafeinteger', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.isSafeInteger'], + invalid: [{ code: 'Number.isSafeInteger', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-maxsafeinteger.ts b/tests/src/rules/no-number-maxsafeinteger.ts new file mode 100644 index 00000000..b3a92c50 --- /dev/null +++ b/tests/src/rules/no-number-maxsafeinteger.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-maxsafeinteger'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.MAX_SAFE_INTEGER' }, +}; + +new RuleTester().run('no-number-maxsafeinteger', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.MAX_SAFE_INTEGER'], + invalid: [{ code: 'Number.MAX_SAFE_INTEGER', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-minsafeinteger.ts b/tests/src/rules/no-number-minsafeinteger.ts new file mode 100644 index 00000000..7fcf601d --- /dev/null +++ b/tests/src/rules/no-number-minsafeinteger.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-minsafeinteger'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.MIN_SAFE_INTEGER' }, +}; + +new RuleTester().run('no-number-minsafeinteger', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.MIN_SAFE_INTEGER'], + invalid: [{ code: 'Number.MIN_SAFE_INTEGER', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-parsefloat.ts b/tests/src/rules/no-number-parsefloat.ts new file mode 100644 index 00000000..eeb16e29 --- /dev/null +++ b/tests/src/rules/no-number-parsefloat.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-parsefloat'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.parseFloat' }, +}; + +new RuleTester().run('no-number-parsefloat', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.parseFloat'], + invalid: [{ code: 'Number.parseFloat', errors: [error] }], +}); diff --git a/tests/src/rules/no-number-parseint.ts b/tests/src/rules/no-number-parseint.ts new file mode 100644 index 00000000..164e56f7 --- /dev/null +++ b/tests/src/rules/no-number-parseint.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-number-parseint'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Number.parseInt' }, +}; + +new RuleTester().run('no-number-parseint', rule, { + valid: ['Number', 'Number.xyz', 'let Number = 0; Number.parseInt'], + invalid: [{ code: 'Number.parseInt', errors: [error] }], +}); diff --git a/tests/src/rules/no-numeric-separators.ts b/tests/src/rules/no-numeric-separators.ts new file mode 100644 index 00000000..c8f89561 --- /dev/null +++ b/tests/src/rules/no-numeric-separators.ts @@ -0,0 +1,24 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-numeric-separators'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, type: AST_NODE_TYPES.Literal, data: {} }; + +if (!RuleTester.isSupported(2021)) { + console.log('Skip the tests of no-numeric-separators.'); +} else { + new RuleTester().run('no-numeric-separators', rule, { + valid: ['123456', '-123', '123.456', '123.0', 'NaN', '123e-1', '0x11', '0b11', '0o11', 'Infinity', '123456n'], + invalid: [ + { code: '123_456', output: '123456', errors: [error] }, + { code: '5_000', output: '5000', errors: [error] }, + { code: '1_234_56', output: '123456', errors: [error] }, + { code: '5.00_00', output: '5.0000', errors: [error] }, + { code: '0b11_01', output: '0b1101', errors: [error] }, + { code: '5e1_000', output: '5e1000', errors: [error] }, + { code: '0xBE_EF', output: '0xBEEF', errors: [error] }, + { code: '123_456n', output: '123456n', errors: [error] }, + ], + }); +} diff --git a/tests/src/rules/no-object-assign.ts b/tests/src/rules/no-object-assign.ts new file mode 100644 index 00000000..74aed1af --- /dev/null +++ b/tests/src/rules/no-object-assign.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-assign'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.assign' }, +}; + +new RuleTester().run('no-object-assign', rule, { + valid: ['Object', 'Object.is', 'let Object = 0; Object.assign'], + invalid: [{ code: 'Object.assign', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-defineproperties.ts b/tests/src/rules/no-object-defineproperties.ts new file mode 100644 index 00000000..4c0e7093 --- /dev/null +++ b/tests/src/rules/no-object-defineproperties.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-defineproperties'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.defineProperties' }, +}; + +new RuleTester().run('no-object-defineproperties', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.defineProperties'], + invalid: [{ code: 'Object.defineProperties', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-defineproperty.ts b/tests/src/rules/no-object-defineproperty.ts new file mode 100644 index 00000000..1f404cea --- /dev/null +++ b/tests/src/rules/no-object-defineproperty.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-defineproperty'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.defineProperty' }, +}; + +new RuleTester().run('no-object-defineproperty', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.defineProperty'], + invalid: [{ code: 'Object.defineProperty', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-entries.ts b/tests/src/rules/no-object-entries.ts new file mode 100644 index 00000000..5955d130 --- /dev/null +++ b/tests/src/rules/no-object-entries.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-entries'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.entries' }, +}; + +new RuleTester().run('no-object-entries', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.entries'], + invalid: [{ code: 'Object.entries', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-freeze.ts b/tests/src/rules/no-object-freeze.ts new file mode 100644 index 00000000..4688873b --- /dev/null +++ b/tests/src/rules/no-object-freeze.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-freeze'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.freeze' }, +}; + +new RuleTester().run('no-object-freeze', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.freeze'], + invalid: [{ code: 'Object.freeze', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-fromentries.ts b/tests/src/rules/no-object-fromentries.ts new file mode 100644 index 00000000..b2f5faff --- /dev/null +++ b/tests/src/rules/no-object-fromentries.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-fromentries'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.fromEntries' }, +}; + +new RuleTester().run('no-object-fromentries', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.fromEntries'], + invalid: [{ code: 'Object.fromEntries', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-getownpropertydescriptor.ts b/tests/src/rules/no-object-getownpropertydescriptor.ts new file mode 100644 index 00000000..cce436f6 --- /dev/null +++ b/tests/src/rules/no-object-getownpropertydescriptor.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-getownpropertydescriptor'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.getOwnPropertyDescriptor' }, +}; + +new RuleTester().run('no-object-getownpropertydescriptor', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.getOwnPropertyDescriptor'], + invalid: [{ code: 'Object.getOwnPropertyDescriptor', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-getownpropertydescriptors.ts b/tests/src/rules/no-object-getownpropertydescriptors.ts new file mode 100644 index 00000000..77857aed --- /dev/null +++ b/tests/src/rules/no-object-getownpropertydescriptors.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-getownpropertydescriptors'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.getOwnPropertyDescriptors' }, +}; + +new RuleTester().run('no-object-getownpropertydescriptors', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.getOwnPropertyDescriptors'], + invalid: [{ code: 'Object.getOwnPropertyDescriptors', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-getownpropertynames.ts b/tests/src/rules/no-object-getownpropertynames.ts new file mode 100644 index 00000000..22c34234 --- /dev/null +++ b/tests/src/rules/no-object-getownpropertynames.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-getownpropertynames'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.getOwnPropertyNames' }, +}; + +new RuleTester().run('no-object-getownpropertynames', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.getOwnPropertyNames'], + invalid: [{ code: 'Object.getOwnPropertyNames', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-getownpropertysymbols.ts b/tests/src/rules/no-object-getownpropertysymbols.ts new file mode 100644 index 00000000..d88e198e --- /dev/null +++ b/tests/src/rules/no-object-getownpropertysymbols.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-getownpropertysymbols'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.getOwnPropertySymbols' }, +}; + +new RuleTester().run('no-object-getownpropertysymbols', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.getOwnPropertySymbols'], + invalid: [{ code: 'Object.getOwnPropertySymbols', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-getprototypeof.ts b/tests/src/rules/no-object-getprototypeof.ts new file mode 100644 index 00000000..6fa14a28 --- /dev/null +++ b/tests/src/rules/no-object-getprototypeof.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-getprototypeof'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.getPrototypeOf' }, +}; + +new RuleTester().run('no-object-getprototypeof', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.getPrototypeOf'], + invalid: [{ code: 'Object.getPrototypeOf', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-is.ts b/tests/src/rules/no-object-is.ts new file mode 100644 index 00000000..9dfab2ee --- /dev/null +++ b/tests/src/rules/no-object-is.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-is'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.is' }, +}; + +new RuleTester().run('no-object-is', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.is'], + invalid: [{ code: 'Object.is', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-isextensible.ts b/tests/src/rules/no-object-isextensible.ts new file mode 100644 index 00000000..cff5b6f2 --- /dev/null +++ b/tests/src/rules/no-object-isextensible.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-isextensible'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.isExtensible' }, +}; + +new RuleTester().run('no-object-isextensible', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.isExtensible'], + invalid: [{ code: 'Object.isExtensible', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-isfrozen.ts b/tests/src/rules/no-object-isfrozen.ts new file mode 100644 index 00000000..90af683a --- /dev/null +++ b/tests/src/rules/no-object-isfrozen.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-isfrozen'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.isFrozen' }, +}; + +new RuleTester().run('no-object-isfrozen', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.isFrozen'], + invalid: [{ code: 'Object.isFrozen', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-issealed.ts b/tests/src/rules/no-object-issealed.ts new file mode 100644 index 00000000..2b3063d3 --- /dev/null +++ b/tests/src/rules/no-object-issealed.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-issealed'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.isSealed' }, +}; + +new RuleTester().run('no-object-issealed', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.isSealed'], + invalid: [{ code: 'Object.isSealed', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-keys.ts b/tests/src/rules/no-object-keys.ts new file mode 100644 index 00000000..480c8f12 --- /dev/null +++ b/tests/src/rules/no-object-keys.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-keys'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.keys' }, +}; + +new RuleTester().run('no-object-keys', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.keys'], + invalid: [{ code: 'Object.keys', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-preventextensions.ts b/tests/src/rules/no-object-preventextensions.ts new file mode 100644 index 00000000..49e9ee09 --- /dev/null +++ b/tests/src/rules/no-object-preventextensions.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-preventextensions'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.preventExtensions' }, +}; + +new RuleTester().run('no-object-preventextensions', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.preventExtensions'], + invalid: [{ code: 'Object.preventExtensions', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-seal.ts b/tests/src/rules/no-object-seal.ts new file mode 100644 index 00000000..d04ae130 --- /dev/null +++ b/tests/src/rules/no-object-seal.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-seal'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.seal' }, +}; + +new RuleTester().run('no-object-seal', rule, { + valid: ['Object', 'Object.foo', 'let Object = 0; Object.seal'], + invalid: [{ code: 'Object.seal', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-setprototypeof.ts b/tests/src/rules/no-object-setprototypeof.ts new file mode 100644 index 00000000..a53f8bdb --- /dev/null +++ b/tests/src/rules/no-object-setprototypeof.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-setprototypeof'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.setPrototypeOf' }, +}; + +new RuleTester().run('no-object-setprototypeof', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.setPrototypeOf'], + invalid: [{ code: 'Object.setPrototypeOf', errors: [error] }], +}); diff --git a/tests/src/rules/no-object-super-properties.ts b/tests/src/rules/no-object-super-properties.ts new file mode 100644 index 00000000..cf1084ed --- /dev/null +++ b/tests/src/rules/no-object-super-properties.ts @@ -0,0 +1,26 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-super-properties'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Super, data: {} }; + +new RuleTester().run('no-object-super-properties', rule, { + valid: [ + 'class A { foo() { super.a } }', + 'class A { foo() { super.foo() } }', + 'class A extends B { constructor() { super() } }', + ], + invalid: [ + { code: '({ foo() { super.a } })', errors: [{ ...error, column: 12 }] }, + { code: '({ foo() { super.foo() } })', errors: [{ ...error, column: 12 }] }, + { code: '({ foo() { return () => super.a } })', errors: [{ ...error, column: 25 }] }, + { + code: '({ foo() { ({ foo() { return () => super.a } }); class A { foo() { super.a } } return () => super.a } })', + errors: [ + { ...error, column: 36 }, + { ...error, column: 93 }, + ], + }, + ], +}); diff --git a/tests/src/rules/no-object-values.ts b/tests/src/rules/no-object-values.ts new file mode 100644 index 00000000..59b1ba7a --- /dev/null +++ b/tests/src/rules/no-object-values.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-object-values'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Object.values' }, +}; + +new RuleTester().run('no-object-values', rule, { + valid: ['Object', 'Object.assign', 'let Object = 0; Object.values'], + invalid: [{ code: 'Object.values', errors: [error] }], +}); diff --git a/tests/src/rules/no-octal-numeric-literals.ts b/tests/src/rules/no-octal-numeric-literals.ts new file mode 100644 index 00000000..fce7da1a --- /dev/null +++ b/tests/src/rules/no-octal-numeric-literals.ts @@ -0,0 +1,14 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-octal-numeric-literals'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, type: AST_NODE_TYPES.Literal, data: {} }; + +new RuleTester().run('no-octal-numeric-literals', rule, { + valid: ['123', '0123', '0x123', '0X123', '0b10', '0B10', '/*0o123*/x'], + invalid: [ + { code: '0o123', errors: [error] }, + { code: '0O123', errors: [error] }, + ], +}); diff --git a/tests/src/rules/no-optional-catch-binding.ts b/tests/src/rules/no-optional-catch-binding.ts new file mode 100644 index 00000000..8045579a --- /dev/null +++ b/tests/src/rules/no-optional-catch-binding.ts @@ -0,0 +1,15 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-optional-catch-binding'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 8, type: AST_NODE_TYPES.CatchClause, data: {} }; + +if (!RuleTester.isSupported(2019)) { + console.log('Skip the tests of no-optional-catch-binding.'); +} else { + new RuleTester().run('no-optional-catch-binding', rule, { + valid: ['try {} catch (err) {}'], + invalid: [{ code: 'try {} catch {}', errors: [error] }], + }); +} diff --git a/tests/src/rules/no-optional-chaining.ts b/tests/src/rules/no-optional-chaining.ts new file mode 100644 index 00000000..321d1b99 --- /dev/null +++ b/tests/src/rules/no-optional-chaining.ts @@ -0,0 +1,29 @@ +import { AST_TOKEN_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-optional-chaining'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_TOKEN_TYPES.Punctuator, data: {} }; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-optional-chaining.'); +} else { + new RuleTester().run('no-optional-chaining', rule, { + valid: ['var x = a.b', 'var x = a[b]', 'foo()'], + invalid: [ + { code: 'var x = a?.b', errors: [{ ...error, column: 10, endColumn: 12 }] }, + { code: 'var x = a?.[b]', errors: [{ ...error, column: 10, endColumn: 12 }] }, + { code: 'foo?.()', errors: [{ ...error, column: 4, endColumn: 6 }] }, + { + code: 'var x = ((a?.b)?.c)?.()', + errors: [ + { ...error, column: 12, endColumn: 14 }, + { ...error, column: 16, endColumn: 18 }, + { ...error, column: 20, endColumn: 22 }, + ], + }, + { code: 'var x = a/*?.*/?.b', errors: [{ ...error, column: 16, endColumn: 18 }] }, + { code: "var x = '?.'?.['?.']", errors: [{ ...error, column: 13, endColumn: 15 }] }, + ], + }); +} diff --git a/tests/src/rules/no-promise-all-settled.ts b/tests/src/rules/no-promise-all-settled.ts new file mode 100644 index 00000000..97034a02 --- /dev/null +++ b/tests/src/rules/no-promise-all-settled.ts @@ -0,0 +1,15 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-promise-all-settled'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 1, type: AST_NODE_TYPES.MemberExpression, data: {} }; + +if (!RuleTester.isSupported(2020)) { + console.log('Skip the tests of no-promise-all-settled.'); +} else { + new RuleTester().run('no-promise-all-settled', rule, { + valid: ['Promise.all'], + invalid: [{ code: 'Promise.allSettled', errors: [error] }], + }); +} diff --git a/tests/src/rules/no-promise-any.ts b/tests/src/rules/no-promise-any.ts new file mode 100644 index 00000000..7284a873 --- /dev/null +++ b/tests/src/rules/no-promise-any.ts @@ -0,0 +1,20 @@ +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-promise-any'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; + +const error = (promiseAny?: 'Promise.any'): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: promiseAny ? AST_NODE_TYPES.MemberExpression : AST_NODE_TYPES.Identifier, + data: { name: promiseAny ?? 'AggregateError' }, +}); + +new RuleTester().run('no-promise-any', rule, { + valid: ['Promise.all', 'Error', 'RangeError'], + invalid: [ + { code: 'Promise.any', errors: [{ ...error('Promise.any'), column: 1 }] }, + { code: 'AggregateError', errors: [{ ...error(), column: 1 }] }, + { code: 'console.log(e instanceof AggregateError)', errors: [{ ...error(), column: 26 }] }, + ], +}); diff --git a/tests/src/rules/no-promise-prototype-finally.ts b/tests/src/rules/no-promise-prototype-finally.ts new file mode 100644 index 00000000..865d11b9 --- /dev/null +++ b/tests/src/rules/no-promise-prototype-finally.ts @@ -0,0 +1,97 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-promise-prototype-finally'; + +const ruleId = 'no-promise-prototype-finally'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Promise.prototype.finally' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'foo.then(() => {})', + 'foo.finally(() => {})', + { code: 'foo.then(() => {})', settings: { es: { aggressive: true } } }, + { code: 'foo.finally(() => {})', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.finally(() => {})', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.finally(() => {})', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'foo.then(() => {})' }, + { filename, code: 'foo.finally(() => {})' }, + { filename, code: 'let foo = {}; foo.finally(() => {})' }, + { filename, code: 'foo.then(() => {})', settings: { es: { aggressive: true } } }, + + // `Promise` is unknown type if tsconfig.json is not configured. + { filename, code: 'async function f() {} f().finally(() => {})' }, + { filename, code: 'let foo = Promise.resolve(); foo.finally(() => {})' }, + ], + invalid: [ + { + filename, + code: 'async function f() {} f().finally(() => {})', + errors: [{ ...error, column: 23 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'let foo = Promise.resolve(); foo.finally(() => {})', + errors: [{ ...error, column: 30 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: 'foo.finally(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); + +new RuleTester({ + parser, + parserOptions: { tsconfigRootDir, project }, +}).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'foo.then(() => {})' }, + { filename, code: 'foo.finally(() => {})' }, + { filename, code: 'let foo = {}; foo.finally(() => {})' }, + { filename, code: 'foo.then(() => {})', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: 'async function f() {} f().finally(() => {})', errors: [{ ...error, column: 23 }] }, + { filename, code: 'async function f() {} let foo = f(); foo.finally(() => {})', errors: [{ ...error, column: 38 }] }, + { filename, code: 'let foo = Promise.resolve(); foo.finally(() => {})', errors: [{ ...error, column: 30 }] }, + { filename, code: 'Promise.resolve().finally(() => {})', errors: [{ ...error, column: 1 }] }, + { filename, code: 'Promise.resolve().then(() => {}).finally(() => {})', errors: [{ ...error, column: 1 }] }, + { + filename, + code: 'foo.finally(() => {})', + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + ], +}); diff --git a/tests/src/rules/no-promise.ts b/tests/src/rules/no-promise.ts new file mode 100644 index 00000000..9593d79b --- /dev/null +++ b/tests/src/rules/no-promise.ts @@ -0,0 +1,14 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-promise'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Identifier, data: { name: 'Promise' } }; + +new RuleTester().run('no-promise', rule, { + valid: ['Array', 'Object', 'let Promise = 0; Promise'], + invalid: [ + { code: 'Promise', errors: [{ ...error, column: 1 }] }, + { code: 'function f() { Promise }', errors: [{ ...error, column: 16 }] }, + ], +}); diff --git a/tests/src/rules/no-property-shorthands.ts b/tests/src/rules/no-property-shorthands.ts new file mode 100644 index 00000000..ccc7b018 --- /dev/null +++ b/tests/src/rules/no-property-shorthands.ts @@ -0,0 +1,26 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-property-shorthands'; + +const error = { messageId: 'forbidden' as const, line: 1, column: 4, type: AST_NODE_TYPES.Property, data: {} }; + +new RuleTester().run('no-property-shorthands', rule, { + valid: [ + '({})', + '({ a: 1 })', + '({ a: function(){} })', + '({ get a() {}, set a(value) {} })', + '({ [a]: 1 })', + '({ ...a })', + '({ a } = obj)', + ], + invalid: [ + { code: '({ a })', output: '({ a: a })', errors: [error] }, + { code: '({ a() {} })', output: '({ a: function() {} })', errors: [error] }, + { code: '({ * a() {} })', output: '({ a: function*() {} })', errors: [error] }, + { code: '({ [a]() {} })', output: '({ [a]: function() {} })', errors: [error] }, + { code: '({ async a() {} })', output: '({ a: async function() {} })', errors: [error] }, + { code: '({ async * [a]() {} })', output: '({ [a]: async function*() {} })', errors: [error] }, + ], +}); diff --git a/tests/src/rules/no-proxy.ts b/tests/src/rules/no-proxy.ts new file mode 100644 index 00000000..efcf47f4 --- /dev/null +++ b/tests/src/rules/no-proxy.ts @@ -0,0 +1,20 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-proxy'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Identifier, data: { name: 'Proxy' } }; + +new RuleTester().run('no-proxy', rule, { + valid: ['Array', 'Object', 'let Proxy = 0; Proxy'], + invalid: [ + { + code: 'Proxy', + errors: [{ ...error, column: 1 }], + }, + { + code: 'function f() { Proxy }', + errors: [{ ...error, column: 16 }], + }, + ], +}); diff --git a/tests/src/rules/no-reflect.ts b/tests/src/rules/no-reflect.ts new file mode 100644 index 00000000..7a14999f --- /dev/null +++ b/tests/src/rules/no-reflect.ts @@ -0,0 +1,14 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-reflect'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Identifier, data: { name: 'Reflect' } }; + +new RuleTester().run('no-reflect', rule, { + valid: ['Array', 'Object', 'let Reflect = 0; Reflect'], + invalid: [ + { code: 'Reflect', errors: [{ ...error, column: 1 }] }, + { code: 'function f() { Reflect }', errors: [{ ...error, column: 16 }] }, + ], +}); diff --git a/tests/src/rules/no-regexp-lookbehind-assertions.ts b/tests/src/rules/no-regexp-lookbehind-assertions.ts new file mode 100644 index 00000000..aa8b75b4 --- /dev/null +++ b/tests/src/rules/no-regexp-lookbehind-assertions.ts @@ -0,0 +1,46 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-regexp-lookbehind-assertions'; + +const baseError = { messageId: 'forbidden' as const, line: 1, column: 1, data: {} }; +const literalError = { ...baseError, type: AST_NODE_TYPES.Literal }; +const newError = { ...baseError, type: AST_NODE_TYPES.NewExpression }; + +new RuleTester().run('no-regexp-lookbehind-assertions', rule, { + valid: [ + String.raw`/(?=a)b/`, + String.raw`/(?!a)b/`, + String.raw`/(\?<=a)b/`, + String.raw`/(\?/`, + String.raw`/\(?a\)b/`, + String.raw`/\\\(?a\)b/`, + String.raw`new RegExp('foo')`, + String.raw`new RegExp('\\k')`, + String.raw`new RegExp('\\(?a\\)b')`, + String.raw`new RegExp('\\\\\\(?a\\)b')`, + + // Capture groups but unnamed. + '/(foo)\\1/', + + // Allow those in character classes. + String.raw`/[(?a)b]/`, + String.raw`/[(?a)b\k]/`, + + // Ignore syntax errors. + String.raw`new RegExp("(?a)b/`, errors: [literalError] }, + { code: String.raw`/(?a)b\k/`, errors: [literalError] }, + { code: String.raw`/\\(?a)b/`, errors: [literalError] }, + { code: String.raw`/\(?a\)\\(?a)b/`, errors: [literalError] }, + { code: String.raw`new RegExp("(?a)b")`, errors: [newError] }, + { code: String.raw`new RegExp("(?a)b\\k")`, errors: [newError] }, + { code: String.raw`new RegExp("\\\\(?a)b")`, errors: [newError] }, + { code: String.raw`new RegExp("\\(?a\\)\\\\(?a)b")`, errors: [newError] }, + ], +}); diff --git a/tests/src/rules/no-regexp-prototype-flags.ts b/tests/src/rules/no-regexp-prototype-flags.ts new file mode 100644 index 00000000..55c8132a --- /dev/null +++ b/tests/src/rules/no-regexp-prototype-flags.ts @@ -0,0 +1,86 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-regexp-prototype-flags'; + +const ruleId = 'no-regexp-prototype-flags'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'RegExp.prototype.flags' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'foo.global', + 'foo.flags', + { code: 'foo.global', settings: { es: { aggressive: true } } }, + { code: 'foo.flags', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.flags', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.flags', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'foo.global' }, + { filename, code: 'foo.flags' }, + { filename, code: 'let foo = {}; foo.flags' }, + { filename, code: 'foo.global', settings: { es: { aggressive: true } } }, + + // `RegExp` is unknown type if tsconfig.json is not configured. + { filename, code: "new RegExp('').flags" }, + { filename, code: "let foo = new RegExp(''); foo.flags" }, + ], + invalid: [ + { filename, code: '/foo/.flags', errors: [{ ...error, column: 1 }] }, + { + filename, + code: "new RegExp('').flags", + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: true } }, + }, + { + filename, + code: "let foo = new RegExp(''); foo.flags", + errors: [{ ...error, column: 27 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.flags', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ + parser, + parserOptions: { tsconfigRootDir, project }, +}).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'foo.global' }, + { filename, code: 'foo.flags' }, + { filename, code: 'let foo = {}; foo.flags' }, + { filename, code: 'foo.global', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: '/foo/.flags', errors: [{ ...error, column: 1 }] }, + { filename, code: "new RegExp('').flags", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = new RegExp(''); foo.flags", errors: [{ ...error, column: 27 }] }, + { filename, code: 'foo.flags', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-regexp-s-flag.ts b/tests/src/rules/no-regexp-s-flag.ts new file mode 100644 index 00000000..667755f8 --- /dev/null +++ b/tests/src/rules/no-regexp-s-flag.ts @@ -0,0 +1,26 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-regexp-s-flag'; + +const baseError = { messageId: 'forbidden' as const, line: 1, column: 1, data: {} }; +const literalError = { ...baseError, type: AST_NODE_TYPES.Literal }; +const newError = { ...baseError, type: AST_NODE_TYPES.NewExpression }; + +new RuleTester().run('no-regexp-s-flag', rule, { + valid: [ + '/foo/gimuy', + 'a\n/b/s', + "new RegExp('foo', 'gimuy')", + "new RegExp('foo')", + "new RegExp('foo', flags)", + "const flags = 'gimuy'; new RegExp('foo', flags)", + ], + invalid: [ + { code: '/foo/s', errors: [literalError] }, + { code: '/foo/gimsuy', errors: [literalError] }, + { code: "new RegExp('foo', 's')", errors: [newError] }, + { code: "new RegExp('foo', 'gimsuy')", errors: [newError] }, + { code: "const flags = 's'; new RegExp('foo', flags)", errors: [{ ...newError, column: 20 }] }, + ], +}); diff --git a/tests/src/rules/no-regexp-u-flag.ts b/tests/src/rules/no-regexp-u-flag.ts new file mode 100644 index 00000000..562ff1a5 --- /dev/null +++ b/tests/src/rules/no-regexp-u-flag.ts @@ -0,0 +1,26 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-regexp-u-flag'; + +const baseError = { messageId: 'forbidden' as const, line: 1, column: 1, data: {} }; +const literalError = { ...baseError, type: AST_NODE_TYPES.Literal }; +const newError = { ...baseError, type: AST_NODE_TYPES.NewExpression }; + +new RuleTester().run('no-regexp-u-flag', rule, { + valid: [ + '/foo/gimsy', + 'a\n/b/s', + "new RegExp('foo', 'gimsy')", + "new RegExp('foo')", + "new RegExp('foo', flags)", + "const flags = 'gimsy'; new RegExp('foo', flags)", + ], + invalid: [ + { code: '/foo/u', errors: [literalError] }, + { code: '/foo/gimsuy', errors: [literalError] }, + { code: "new RegExp('foo', 'u')", errors: [newError] }, + { code: "new RegExp('foo', 'gimsuy')", errors: [newError] }, + { code: "const flags = 'u'; new RegExp('foo', flags)", errors: [{ ...newError, column: 20 }] }, + ], +}); diff --git a/tests/src/rules/no-regexp-unicode-property-escapes-2019.ts b/tests/src/rules/no-regexp-unicode-property-escapes-2019.ts new file mode 100644 index 00000000..8d5eda12 --- /dev/null +++ b/tests/src/rules/no-regexp-unicode-property-escapes-2019.ts @@ -0,0 +1,60 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-regexp-unicode-property-escapes-2019'; + +const error = (options?: { value?: string; notLiteral?: boolean }): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: options?.notLiteral ? AST_NODE_TYPES.NewExpression : AST_NODE_TYPES.Literal, + data: { value: `\\p{${options?.value ? `Script=${options.value}` : 'Extended_Pictographic'}}` }, +}); + +if (!RuleTester.isSupported(2019)) { + console.log('Skip the tests of no-regexp-unicode-property-escapes-2019.'); +} else { + new RuleTester().run('no-regexp-unicode-property-escapes-2019', rule, { + valid: [ + String.raw`/\p{Letter}/u`, + String.raw`/\P{Letter}/u`, + String.raw`/\p{Script=Hiragana}/u`, + String.raw`/\P{Script=Hiragana}/u`, + String.raw`/\p{Extended_Pictographic}/`, + String.raw`/\P{Extended_Pictographic}/`, + String.raw`/\p{Script=Dogr}/`, + String.raw`/\P{Script=Dogr}/`, + String.raw`new RegExp('\\p{Extended_Pictographic}')`, + String.raw`new RegExp('\\\\p{Extended_Pictographic}', 'u')`, + ], + invalid: [ + { code: String.raw`/\p{Extended_Pictographic}/u`, errors: [{ ...error(), column: 1 }] }, + { code: String.raw`/\\\p{Extended_Pictographic}/u`, errors: [{ ...error(), column: 1 }] }, + { + code: String.raw`new RegExp('\\p{Extended_Pictographic}', 'u')`, + errors: [{ ...error({ notLiteral: true }), column: 1 }], + }, + { + code: String.raw`new RegExp('\\\\\\p{Extended_Pictographic}', 'u')`, + errors: [{ ...error({ notLiteral: true }), column: 1 }], + }, + { code: String.raw`/\p{Script=Dogr}/u`, errors: [{ ...error({ value: 'Dogr' }), column: 1 }] }, + { code: String.raw`/\p{Script=Dogra}/u`, errors: [{ ...error({ value: 'Dogra' }), column: 1 }] }, + { code: String.raw`/\p{Script=Gong}/u`, errors: [{ ...error({ value: 'Gong' }), column: 1 }] }, + { code: String.raw`/\p{Script=Gunjala_Gondi}/u`, errors: [{ ...error({ value: 'Gunjala_Gondi' }), column: 1 }] }, + { + code: String.raw`/\p{Script=Hanifi_Rohingya}/u`, + errors: [{ ...error({ value: 'Hanifi_Rohingya' }), column: 1 }], + }, + { code: String.raw`/\p{Script=Maka}/u`, errors: [{ ...error({ value: 'Maka' }), column: 1 }] }, + { code: String.raw`/\p{Script=Makasar}/u`, errors: [{ ...error({ value: 'Makasar' }), column: 1 }] }, + { code: String.raw`/\p{Script=Medefaidrin}/u`, errors: [{ ...error({ value: 'Medefaidrin' }), column: 1 }] }, + { code: String.raw`/\p{Script=Medf}/u`, errors: [{ ...error({ value: 'Medf' }), column: 1 }] }, + { code: String.raw`/\p{Script=Old_Sogdian}/u`, errors: [{ ...error({ value: 'Old_Sogdian' }), column: 1 }] }, + { code: String.raw`/\p{Script=Rohg}/u`, errors: [{ ...error({ value: 'Rohg' }), column: 1 }] }, + { code: String.raw`/\p{Script=Sogd}/u`, errors: [{ ...error({ value: 'Sogd' }), column: 1 }] }, + { code: String.raw`/\p{Script=Sogdian}/u`, errors: [{ ...error({ value: 'Sogdian' }), column: 1 }] }, + { code: String.raw`/\p{Script=Sogo}/u`, errors: [{ ...error({ value: 'Sogo' }), column: 1 }] }, + ], + }); +} diff --git a/tests/src/rules/no-regexp-unicode-property-escapes.ts b/tests/src/rules/no-regexp-unicode-property-escapes.ts new file mode 100644 index 00000000..ee6c3ac0 --- /dev/null +++ b/tests/src/rules/no-regexp-unicode-property-escapes.ts @@ -0,0 +1,48 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-regexp-unicode-property-escapes'; + +const baseError = { messageId: 'forbidden' as const, line: 1, column: 1, data: {} }; +const literalError = { ...baseError, type: AST_NODE_TYPES.Literal }; +const newError = { ...baseError, type: AST_NODE_TYPES.NewExpression }; + +new RuleTester().run('no-regexp-unicode-property-escapes', rule, { + valid: [ + String.raw`/p{Letter}/`, + String.raw`/P{Letter}/`, + String.raw`/\p{Letter}/`, + String.raw`/\P{Letter}/`, + String.raw`/\\p{Letter}/`, + String.raw`/\\P{Letter}/`, + String.raw`new RegExp('p{Letter}')`, + String.raw`new RegExp('P{Letter}')`, + String.raw`new RegExp('\\p{Letter}')`, + String.raw`new RegExp('\\P{Letter}')`, + String.raw`new RegExp('\\\\p{Letter}')`, + String.raw`new RegExp('\\\\P{Letter}')`, + + // Ignore syntax errors. + String.raw`new RegExp('\\p{Letter', 'u')`, + ], + invalid: [ + { code: String.raw`/\p{Letter}/u`, errors: [literalError] }, + { code: String.raw`/\P{Letter}/u`, errors: [literalError] }, + { code: String.raw`/\\\p{Letter}/u`, errors: [literalError] }, + { code: String.raw`/\\\P{Letter}/u`, errors: [literalError] }, + { code: String.raw`/\p{Script=Hiragana}/u`, errors: [literalError] }, + { code: String.raw`new RegExp('\\p{Letter}', 'u')`, errors: [newError] }, + { code: String.raw`new RegExp('\\P{Letter}', 'u')`, errors: [newError] }, + { code: String.raw`new RegExp('\\\\\\p{Letter}', 'u')`, errors: [newError] }, + { code: String.raw`new RegExp('\\\\\\P{Letter}', 'u')`, errors: [newError] }, + { code: String.raw`new RegExp('\\p{Script=Hiragana}', 'u')`, errors: [newError] }, + { + code: String.raw`const pattern = '\\p{Script=Hiragana}', flags = 'u', regex = new RegExp(pattern, flags)`, + errors: [{ ...newError, column: 62 }], + }, + + // It's valid even if in character classes. + { code: String.raw`/[\p{Letter}]/u`, errors: [literalError] }, + { code: String.raw`/[\P{Letter}]/u`, errors: [literalError] }, + ], +}); diff --git a/tests/src/rules/no-regexp-y-flag.ts b/tests/src/rules/no-regexp-y-flag.ts new file mode 100644 index 00000000..85444d60 --- /dev/null +++ b/tests/src/rules/no-regexp-y-flag.ts @@ -0,0 +1,26 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-regexp-y-flag'; + +const baseError = { messageId: 'forbidden' as const, line: 1, column: 1, data: {} }; +const literalError = { ...baseError, type: AST_NODE_TYPES.Literal }; +const newError = { ...baseError, type: AST_NODE_TYPES.NewExpression }; + +new RuleTester().run('no-regexp-y-flag', rule, { + valid: [ + '/foo/gimsu', + 'a\n/b/s', + "new RegExp('foo', 'gimsu')", + "new RegExp('foo')", + "new RegExp('foo', flags)", + "const flags = 'gimsu'; new RegExp('foo', flags)", + ], + invalid: [ + { code: '/foo/y', errors: [literalError] }, + { code: '/foo/gimsuy', errors: [literalError] }, + { code: "new RegExp('foo', 'y')", errors: [newError] }, + { code: "new RegExp('foo', 'gimsuy')", errors: [newError] }, + { code: "const flags = 'y'; new RegExp('foo', flags)", errors: [{ ...newError, column: 20 }] }, + ], +}); diff --git a/tests/src/rules/no-rest-parameters.ts b/tests/src/rules/no-rest-parameters.ts new file mode 100644 index 00000000..3b4fafd6 --- /dev/null +++ b/tests/src/rules/no-rest-parameters.ts @@ -0,0 +1,26 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-rest-parameters'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.RestElement, data: {} }; + +new RuleTester().run('no-rest-parameters', rule, { + valid: [ + '[a, ...b]', + '[a, ...b] = array', + 'f(...a)', + 'new F(...a)', + 'function f([...a]) {}', + '({...a})', + '({...a} = obj)', + ], + invalid: [ + { code: 'function f(...a) {}', errors: [{ ...error, column: 12 }] }, + { code: '(function(...a) {})', errors: [{ ...error, column: 11 }] }, + { code: '(...a) => {}', errors: [{ ...error, column: 2 }] }, + { code: '({ f(...a) {} })', errors: [{ ...error, column: 6 }] }, + { code: 'class A { f(...a) {} }', errors: [{ ...error, column: 13 }] }, + { code: '(class { f(...a) {} })', errors: [{ ...error, column: 12 }] }, + ], +}); diff --git a/tests/src/rules/no-rest-spread-properties.ts b/tests/src/rules/no-rest-spread-properties.ts new file mode 100644 index 00000000..22f775ab --- /dev/null +++ b/tests/src/rules/no-rest-spread-properties.ts @@ -0,0 +1,16 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-rest-spread-properties'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.RestElement, data: {} }; + +new RuleTester().run('no-rest-spread-properties', rule, { + valid: ['[...a]', '[...a] = array', '({a: [...b]})', '({a: [...b]} = obj)', 'function f(...a) {}', 'f(...a)'], + invalid: [ + { code: '({...a})', errors: [{ ...error, column: 3, type: AST_NODE_TYPES.SpreadElement }] }, + { code: '({...a} = obj)', errors: [{ ...error, column: 3 }] }, + { code: 'for ({...a} of x) {}', errors: [{ ...error, column: 7 }] }, + { code: 'function f({...a}) {}', errors: [{ ...error, column: 13 }] }, + ], +}); diff --git a/tests/src/rules/no-set.ts b/tests/src/rules/no-set.ts new file mode 100644 index 00000000..4d15ecd3 --- /dev/null +++ b/tests/src/rules/no-set.ts @@ -0,0 +1,14 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-set'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Identifier, data: { name: 'Set' } }; + +new RuleTester().run('no-set', rule, { + valid: ['Array', 'Object', 'let Set = 0; Set'], + invalid: [ + { code: 'Set', errors: [{ ...error, column: 1 }] }, + { code: 'function f() { Set }', errors: [{ ...error, column: 16 }] }, + ], +}); diff --git a/tests/src/rules/no-shared-array-buffer.ts b/tests/src/rules/no-shared-array-buffer.ts new file mode 100644 index 00000000..9331d16a --- /dev/null +++ b/tests/src/rules/no-shared-array-buffer.ts @@ -0,0 +1,25 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-shared-array-buffer'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.Identifier, + data: { name: 'SharedArrayBuffer' }, +}; + +new RuleTester().run('no-shared-array-buffer', rule, { + valid: ['Array', 'Object', 'let SharedArrayBuffer = 0; SharedArrayBuffer'], + invalid: [ + { + code: 'SharedArrayBuffer', + errors: [{ ...error, column: 1 }], + }, + { + code: 'function f() { SharedArrayBuffer }', + errors: [{ ...error, column: 16 }], + }, + ], +}); diff --git a/tests/src/rules/no-spread-elements.ts b/tests/src/rules/no-spread-elements.ts new file mode 100644 index 00000000..165c1117 --- /dev/null +++ b/tests/src/rules/no-spread-elements.ts @@ -0,0 +1,16 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-spread-elements'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.SpreadElement, data: {} }; + +new RuleTester().run('no-spread-elements', rule, { + valid: ['[a, ...b] = array', 'function f(a, ...b) {}', 'for ([a, ...b] of c) {}', '({ ...a })', '({ ...a } = obj)'], + invalid: [ + { code: 'f(...a, b)', errors: [{ ...error, column: 3 }] }, + { code: 'f(a, ...b)', errors: [{ ...error, column: 6 }] }, + { code: 'new F(...a, b)', errors: [{ ...error, column: 7 }] }, + { code: '[...a, b]', errors: [{ ...error, column: 2 }] }, + ], +}); diff --git a/tests/src/rules/no-string-fromcodepoint.ts b/tests/src/rules/no-string-fromcodepoint.ts new file mode 100644 index 00000000..33ad8e05 --- /dev/null +++ b/tests/src/rules/no-string-fromcodepoint.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-fromcodepoint'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.fromCodePoint' }, +}; + +new RuleTester().run('no-string-fromcodepoint', rule, { + valid: ['String', 'String.raw', 'let String = 0; String.fromCodePoint'], + invalid: [{ code: 'String.fromCodePoint', errors: [error] }], +}); diff --git a/tests/src/rules/no-string-prototype-codepointat.ts b/tests/src/rules/no-string-prototype-codepointat.ts new file mode 100644 index 00000000..4a4df7b3 --- /dev/null +++ b/tests/src/rules/no-string-prototype-codepointat.ts @@ -0,0 +1,84 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-codepointat'; + +const ruleId = 'no-string-prototype-codepointat'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.codePointAt' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'codePointAt(0)', + 'foo.charAt(0)', + 'foo.codePointAt(0)', + { code: 'codePointAt(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.codePointAt(0)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.codePointAt(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.codePointAt(0)', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + 'codePointAt(0)', + 'foo.charAt(0)', + 'foo.codePointAt(0)', + 'let foo = {}; foo.codePointAt(0)', + { code: 'codePointAt(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + 'let foo = String(); foo.codePointAt(0)', + ], + invalid: [ + { code: "let foo = ''; foo.codePointAt(0)", errors: [{ ...error, column: 15 }] }, + { code: 'function f(a: T) { a.codePointAt(0) }', errors: [{ ...error, column: 38 }] }, + { code: "function f(a: T) { a.codePointAt(0) }", errors: [{ ...error, column: 41 }] }, + { + code: 'let foo = String(); foo.codePointAt(0)', + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { code: 'foo.codePointAt(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Types`, rule, { + valid: [ + { filename, code: 'codePointAt(0)' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.codePointAt(0)' }, + { filename, code: 'let foo = {}; foo.codePointAt(0)' }, + { filename, code: 'codePointAt(0)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "let foo = ''; foo.codePointAt(0)", errors: [{ ...error, column: 15 }] }, + { filename, code: 'let foo = String(); foo.codePointAt(0)', errors: [{ ...error, column: 21 }] }, + { filename, code: 'function f(a: T) { a.codePointAt(0) }', errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.codePointAt(0) }", errors: [{ ...error, column: 41 }] }, + { filename, code: 'foo.codePointAt(0)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-endswith.ts b/tests/src/rules/no-string-prototype-endswith.ts new file mode 100644 index 00000000..32ca97d5 --- /dev/null +++ b/tests/src/rules/no-string-prototype-endswith.ts @@ -0,0 +1,88 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-endswith'; + +const ruleId = 'no-string-prototype-endswith'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.endsWith' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + "endsWith('a')", + 'foo.charAt(0)', + "foo.endsWith('a')", + { code: "endsWith('a')", settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: "foo.endsWith('a')", options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.endsWith('a')", errors: [{ ...error, column: 1 }] }, + { code: "foo.endsWith('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: "foo.endsWith('a')", + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: "endsWith('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.endsWith('a')" }, + { filename, code: "let foo = {}; foo.endsWith('a')" }, + { filename, code: "endsWith('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: "let foo = String(); foo.endsWith('a')" }, + ], + invalid: [ + { filename, code: "'foo'.endsWith('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.endsWith('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "function f(a: T) { a.endsWith('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.endsWith('a') }", errors: [{ ...error, column: 41 }] }, + { + filename, + code: "let foo = String(); foo.endsWith('a')", + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: "foo.endsWith('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: "endsWith('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.endsWith('a')" }, + { filename, code: "let foo = {}; foo.endsWith('a')" }, + { filename, code: "endsWith('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.endsWith('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.endsWith('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "let foo = String(); foo.endsWith('a')", errors: [{ ...error, column: 21 }] }, + { filename, code: "function f(a: T) { a.endsWith('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.endsWith('a') }", errors: [{ ...error, column: 41 }] }, + { filename, code: "foo.endsWith('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-includes.ts b/tests/src/rules/no-string-prototype-includes.ts new file mode 100644 index 00000000..284748a8 --- /dev/null +++ b/tests/src/rules/no-string-prototype-includes.ts @@ -0,0 +1,91 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-includes'; + +const ruleId = 'no-string-prototype-includes'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.includes' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + "includes('a')", + 'foo.charAt(0)', + "foo.includes('a')", + { code: "includes('a')", settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: "foo.includes('a')", options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + { code: "[foo].includes('a')", settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.includes('a')", errors: [{ ...error, column: 1 }] }, + { code: "foo.includes('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: "foo.includes('a')", + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: "includes('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.includes('a')" }, + { filename, code: "let foo = {}; foo.includes('a')" }, + { filename, code: "includes('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { filename, code: "[foo].includes('a')", settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: "let foo = String(); foo.includes('a')" }, + ], + invalid: [ + { filename, code: "'foo'.includes('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.includes('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "function f(a: T) { a.includes('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.includes('a') }", errors: [{ ...error, column: 41 }] }, + { + filename, + code: "let foo = String(); foo.includes('a')", + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: "foo.includes('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: "includes('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.includes('a')" }, + { filename, code: "let foo = {}; foo.includes('a')" }, + { filename, code: "includes('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { filename, code: "[foo].includes('a')", settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.includes('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.includes('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "let foo = String(); foo.includes('a')", errors: [{ ...error, column: 21 }] }, + { filename, code: "function f(a: T) { a.includes('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.includes('a') }", errors: [{ ...error, column: 41 }] }, + { filename, code: "foo.includes('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-matchall.ts b/tests/src/rules/no-string-prototype-matchall.ts new file mode 100644 index 00000000..4f2e2bbd --- /dev/null +++ b/tests/src/rules/no-string-prototype-matchall.ts @@ -0,0 +1,88 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-matchall'; + +const ruleId = 'no-string-prototype-matchall'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.matchAll' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + "matchAll('a')", + 'foo.charAt(0)', + "foo.matchAll('a')", + { code: "matchAll('a')", settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: "foo.matchAll('a')", options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.matchAll('a')", errors: [{ ...error, column: 1 }] }, + { code: "foo.matchAll('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: "foo.matchAll('a')", + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: "matchAll('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.matchAll('a')" }, + { filename, code: "let foo = {}; foo.matchAll('a')" }, + { filename, code: "matchAll('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: "let foo = String(); foo.matchAll('a')" }, + ], + invalid: [ + { filename, code: "'foo'.matchAll('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.matchAll('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "function f(a: T) { a.matchAll('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.matchAll('a') }", errors: [{ ...error, column: 41 }] }, + { + filename, + code: "let foo = String(); foo.matchAll('a')", + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: "foo.matchAll('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: "matchAll('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.matchAll('a')" }, + { filename, code: "let foo = {}; foo.matchAll('a')" }, + { filename, code: "matchAll('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.matchAll('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.matchAll('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "let foo = String(); foo.matchAll('a')", errors: [{ ...error, column: 21 }] }, + { filename, code: "function f(a: T) { a.matchAll('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.matchAll('a') }", errors: [{ ...error, column: 41 }] }, + { filename, code: "foo.matchAll('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-normalize.ts b/tests/src/rules/no-string-prototype-normalize.ts new file mode 100644 index 00000000..0983880b --- /dev/null +++ b/tests/src/rules/no-string-prototype-normalize.ts @@ -0,0 +1,88 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-normalize'; + +const ruleId = 'no-string-prototype-normalize'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.normalize' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + "normalize('a')", + 'foo.charAt(0)', + "foo.normalize('a')", + { code: "normalize('a')", settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: "foo.normalize('a')", options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.normalize('a')", errors: [{ ...error, column: 1 }] }, + { code: "foo.normalize('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: "foo.normalize('a')", + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: "normalize('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.normalize('a')" }, + { filename, code: "let foo = {}; foo.normalize('a')" }, + { filename, code: "normalize('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: "let foo = String(); foo.normalize('a')" }, + ], + invalid: [ + { filename, code: "'foo'.normalize('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.normalize('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "function f(a: T) { a.normalize('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.normalize('a') }", errors: [{ ...error, column: 41 }] }, + { + filename, + code: "let foo = String(); foo.normalize('a')", + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: "foo.normalize('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: "normalize('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.normalize('a')" }, + { filename, code: "let foo = {}; foo.normalize('a')" }, + { filename, code: "normalize('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.normalize('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.normalize('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "let foo = String(); foo.normalize('a')", errors: [{ ...error, column: 21 }] }, + { filename, code: "function f(a: T) { a.normalize('a') }", errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.normalize('a') }", errors: [{ ...error, column: 41 }] }, + { filename, code: "foo.normalize('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-padstart-padend.ts b/tests/src/rules/no-string-prototype-padstart-padend.ts new file mode 100644 index 00000000..f476dd70 --- /dev/null +++ b/tests/src/rules/no-string-prototype-padstart-padend.ts @@ -0,0 +1,96 @@ +import path from 'path'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-padstart-padend'; + +const ruleId = 'no-string-prototype-padstart-padend'; +const error = (loc?: 'End'): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: `String.prototype.pad${loc ?? 'Start'}` }, +}); + +new RuleTester().run(ruleId, rule, { + valid: [ + 'padStart(2)', + 'padEnd(2)', + 'foo.charAt(0)', + 'foo.padStart(2)', + 'foo.padEnd(2)', + { code: 'padStart(2)', settings: { es: { aggressive: true } } }, + { code: 'padEnd(2)', settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.padStart(2)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.padStart(2)", errors: [{ ...error(), column: 1 }] }, + { code: "'foo'.padEnd(2)", errors: [{ ...error('End'), column: 1 }] }, + { code: 'foo.padStart(2)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + { code: 'foo.padEnd(2)', errors: [{ ...error('End'), column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.padStart(2)', + options: [{ aggressive: true }], + errors: [{ ...error(), column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'padStart(2)' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.padStart(2)' }, + { filename, code: 'let foo = {}; foo.padStart(2)' }, + { filename, code: 'padStart(2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = String(); foo.padStart(2)' }, + ], + invalid: [ + { filename, code: "'foo'.padStart(2)", errors: [{ ...error(), column: 1 }] }, + { filename, code: "'foo'.padEnd(2)", errors: [{ ...error('End'), column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.padStart(2)", errors: [{ ...error(), column: 18 }] }, + { filename, code: 'function f(a: T) { a.padStart(2) }', errors: [{ ...error(), column: 38 }] }, + { filename, code: "function f(a: T) { a.padStart(2) }", errors: [{ ...error(), column: 41 }] }, + { + filename, + code: 'let foo = String(); foo.padStart(2)', + errors: [{ ...error(), column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.padStart(2)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'padStart(2)' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.padStart(2)' }, + { filename, code: 'let foo = {}; foo.padStart(2)' }, + { filename, code: 'padStart(2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.padStart(2)", errors: [{ ...error(), column: 1 }] }, + { filename, code: "'foo'.padEnd(2)", errors: [{ ...error('End'), column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.padStart(2)", errors: [{ ...error(), column: 18 }] }, + { filename, code: 'let foo = String(); foo.padStart(2)', errors: [{ ...error(), column: 21 }] }, + { filename, code: 'function f(a: T) { a.padStart(2) }', errors: [{ ...error(), column: 38 }] }, + { filename, code: "function f(a: T) { a.padStart(2) }", errors: [{ ...error(), column: 41 }] }, + { filename, code: 'foo.padStart(2)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-repeat.ts b/tests/src/rules/no-string-prototype-repeat.ts new file mode 100644 index 00000000..9e902c72 --- /dev/null +++ b/tests/src/rules/no-string-prototype-repeat.ts @@ -0,0 +1,88 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-repeat'; + +const ruleId = 'no-string-prototype-repeat'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.repeat' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'repeat(3)', + 'foo.charAt(0)', + 'foo.repeat(3)', + { code: 'repeat(3)', settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.repeat(3)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.repeat(3)", errors: [{ ...error, column: 1 }] }, + { code: 'foo.repeat(3)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.repeat(3)', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'repeat(3)' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.repeat(3)' }, + { filename, code: 'let foo = {}; foo.repeat(3)' }, + { filename, code: 'repeat(3)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = String(); foo.repeat(3)' }, + ], + invalid: [ + { filename, code: "'foo'.repeat(3)", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.repeat(3)", errors: [{ ...error, column: 18 }] }, + { filename, code: 'function f(a: T) { a.repeat(3) }', errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.repeat(3) }", errors: [{ ...error, column: 41 }] }, + { + filename, + code: 'let foo = String(); foo.repeat(3)', + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.repeat(3)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'repeat(3)' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.repeat(3)' }, + { filename, code: 'let foo = {}; foo.repeat(3)' }, + { filename, code: 'repeat(3)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.repeat(3)", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.repeat(3)", errors: [{ ...error, column: 18 }] }, + { filename, code: 'let foo = String(); foo.repeat(3)', errors: [{ ...error, column: 21 }] }, + { filename, code: 'function f(a: T) { a.repeat(3) }', errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.repeat(3) }", errors: [{ ...error, column: 41 }] }, + { filename, code: 'foo.repeat(3)', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-replaceall.ts b/tests/src/rules/no-string-prototype-replaceall.ts new file mode 100644 index 00000000..0a67fbb2 --- /dev/null +++ b/tests/src/rules/no-string-prototype-replaceall.ts @@ -0,0 +1,96 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-replaceall'; + +const ruleId = 'no-string-prototype-replaceall'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.replaceAll' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + "replaceAll('a')", + 'foo.charAt(0)', + "foo.replaceAll('a')", + { code: "replaceAll('a')", settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: "foo.replaceAll('a')", options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.replaceAll('a')", errors: [{ ...error, column: 1 }] }, + { code: "foo.replaceAll('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: "foo.replaceAll('a')", + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: "replaceAll('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.replaceAll('a')" }, + { filename, code: "let foo = {}; foo.replaceAll('a')" }, + { filename, code: "replaceAll('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: "let foo = String(); foo.replaceAll('a')" }, + ], + invalid: [ + { filename, code: "'foo'.replaceAll('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.replaceAll('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "function f(a: T) { a.replaceAll('a') }", errors: [{ ...error, column: 38 }] }, + { + filename, + code: "function f(a: T) { a.replaceAll('a') }", + errors: [{ ...error, column: 41 }], + }, + { + filename, + code: "let foo = String(); foo.replaceAll('a')", + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: "foo.replaceAll('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: "replaceAll('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.replaceAll('a')" }, + { filename, code: "let foo = {}; foo.replaceAll('a')" }, + { filename, code: "replaceAll('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.replaceAll('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.replaceAll('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "let foo = String(); foo.replaceAll('a')", errors: [{ ...error, column: 21 }] }, + { filename, code: "function f(a: T) { a.replaceAll('a') }", errors: [{ ...error, column: 38 }] }, + { + filename, + code: "function f(a: T) { a.replaceAll('a') }", + errors: [{ ...error, column: 41 }], + }, + { filename, code: "foo.replaceAll('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-startswith.ts b/tests/src/rules/no-string-prototype-startswith.ts new file mode 100644 index 00000000..6bb206b9 --- /dev/null +++ b/tests/src/rules/no-string-prototype-startswith.ts @@ -0,0 +1,96 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-startswith'; + +const ruleId = 'no-string-prototype-startswith'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.startsWith' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + "startsWith('a')", + 'foo.charAt(0)', + "foo.startsWith('a')", + { code: "startsWith('a')", settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: "foo.startsWith('a')", options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.startsWith('a')", errors: [{ ...error, column: 1 }] }, + { code: "foo.startsWith('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: "foo.startsWith('a')", + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: "startsWith('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.startsWith('a')" }, + { filename, code: "let foo = {}; foo.startsWith('a')" }, + { filename, code: "startsWith('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: "let foo = String(); foo.startsWith('a')" }, + ], + invalid: [ + { filename, code: "'foo'.startsWith('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.startsWith('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "function f(a: T) { a.startsWith('a') }", errors: [{ ...error, column: 38 }] }, + { + filename, + code: "function f(a: T) { a.startsWith('a') }", + errors: [{ ...error, column: 41 }], + }, + { + filename, + code: "let foo = String(); foo.startsWith('a')", + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: "foo.startsWith('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: "startsWith('a')" }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: "foo.startsWith('a')" }, + { filename, code: "let foo = {}; foo.startsWith('a')" }, + { filename, code: "startsWith('a')", settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.startsWith('a')", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.startsWith('a')", errors: [{ ...error, column: 18 }] }, + { filename, code: "let foo = String(); foo.startsWith('a')", errors: [{ ...error, column: 21 }] }, + { filename, code: "function f(a: T) { a.startsWith('a') }", errors: [{ ...error, column: 38 }] }, + { + filename, + code: "function f(a: T) { a.startsWith('a') }", + errors: [{ ...error, column: 41 }], + }, + { filename, code: "foo.startsWith('a')", errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-trim.ts b/tests/src/rules/no-string-prototype-trim.ts new file mode 100644 index 00000000..ab6ada87 --- /dev/null +++ b/tests/src/rules/no-string-prototype-trim.ts @@ -0,0 +1,88 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-trim'; + +const ruleId = 'no-string-prototype-trim'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.prototype.trim' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'trim()', + 'foo.charAt(0)', + 'foo.trim()', + { code: 'trim()', settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.trim()', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.trim()", errors: [{ ...error, column: 1 }] }, + { code: 'foo.trim()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.trim()', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'trim()' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.trim()' }, + { filename, code: 'let foo = {}; foo.trim()' }, + { filename, code: 'trim()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = String(); foo.trim()' }, + ], + invalid: [ + { filename, code: "'foo'.trim()", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.trim()", errors: [{ ...error, column: 18 }] }, + { filename, code: 'function f(a: T) { a.trim() }', errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.trim() }", errors: [{ ...error, column: 41 }] }, + { + filename, + code: 'let foo = String(); foo.trim()', + errors: [{ ...error, column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.trim()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'trim()' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.trim()' }, + { filename, code: 'let foo = {}; foo.trim()' }, + { filename, code: 'trim()', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.trim()", errors: [{ ...error, column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.trim()", errors: [{ ...error, column: 18 }] }, + { filename, code: 'let foo = String(); foo.trim()', errors: [{ ...error, column: 21 }] }, + { filename, code: 'function f(a: T) { a.trim() }', errors: [{ ...error, column: 38 }] }, + { filename, code: "function f(a: T) { a.trim() }", errors: [{ ...error, column: 41 }] }, + { filename, code: 'foo.trim()', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-prototype-trimstart-trimend.ts b/tests/src/rules/no-string-prototype-trimstart-trimend.ts new file mode 100644 index 00000000..110cc559 --- /dev/null +++ b/tests/src/rules/no-string-prototype-trimstart-trimend.ts @@ -0,0 +1,108 @@ +import path from 'path'; +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-prototype-trimstart-trimend'; + +const ruleId = 'no-string-prototype-trimstart-trimend'; +const error = (loc?: 'End'): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: `String.prototype.trim${loc ?? 'Start'}` }, +}); + +new RuleTester().run(ruleId, rule, { + valid: [ + 'trimStart(2)', + 'trimEnd(2)', + 'foo.charAt(0)', + 'foo.trimStart(2)', + 'foo.trimEnd(2)', + { code: 'trimStart(2)', settings: { es: { aggressive: true } } }, + { code: 'trimEnd(2)', settings: { es: { aggressive: true } } }, + { code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { code: 'foo.trimStart(2)', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + "'foo'.trimLeft(2)", + "'foo'.trimRight(2)", + { code: 'foo.trimLeft(2)', settings: { es: { aggressive: true } } }, + { code: 'foo.trimRight(2)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: "'foo'.trimStart(2)", errors: [{ ...error(), column: 1 }] }, + { code: "'foo'.trimEnd(2)", errors: [{ ...error('End'), column: 1 }] }, + { code: 'foo.trimStart(2)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + { code: 'foo.trimEnd(2)', errors: [{ ...error('End'), column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.trimStart(2)', + options: [{ aggressive: true }], + errors: [{ ...error(), column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'trimStart(2)' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.trimStart(2)' }, + { filename, code: 'let foo = {}; foo.trimStart(2)' }, + { filename, code: 'trimStart(2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { filename, code: "'foo'.trimLeft(2)" }, + { filename, code: "'foo'.trimRight(2)" }, + { filename, code: 'foo.trimLeft(2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.trimRight(2)', settings: { es: { aggressive: true } } }, + + // `String` is unknown type if tsconfig.json is not configured. + { filename, code: 'let foo = String(); foo.trimStart(2)' }, + ], + invalid: [ + { filename, code: "'foo'.trimStart(2)", errors: [{ ...error(), column: 1 }] }, + { filename, code: "'foo'.trimEnd(2)", errors: [{ ...error('End'), column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.trimStart(2)", errors: [{ ...error(), column: 18 }] }, + { filename, code: 'function f(a: T) { a.trimStart(2) }', errors: [{ ...error(), column: 38 }] }, + { filename, code: "function f(a: T) { a.trimStart(2) }", errors: [{ ...error(), column: 41 }] }, + { + filename, + code: 'let foo = String(); foo.trimStart(2)', + errors: [{ ...error(), column: 21 }], + settings: { es: { aggressive: true } }, + }, + { filename, code: 'foo.trimStart(2)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ parser, parserOptions: { tsconfigRootDir, project } }).run(`${ruleId} TS Full Type Information`, rule, { + valid: [ + { filename, code: 'trimStart(2)' }, + { filename, code: 'foo.charAt(0)' }, + { filename, code: 'foo.trimStart(2)' }, + { filename, code: 'let foo = {}; foo.trimStart(2)' }, + { filename, code: 'trimStart(2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.charAt(0)', settings: { es: { aggressive: true } } }, + { filename, code: "'foo'.trimLeft(2)" }, + { filename, code: "'foo'.trimRight(2)" }, + { filename, code: 'foo.trimLeft(2)', settings: { es: { aggressive: true } } }, + { filename, code: 'foo.trimRight(2)', settings: { es: { aggressive: true } } }, + ], + invalid: [ + { filename, code: "'foo'.trimStart(2)", errors: [{ ...error(), column: 1 }] }, + { filename, code: "'foo'.trimEnd(2)", errors: [{ ...error('End'), column: 1 }] }, + { filename, code: "let foo = 'foo'; foo.trimStart(2)", errors: [{ ...error(), column: 18 }] }, + { filename, code: 'let foo = String(); foo.trimStart(2)', errors: [{ ...error(), column: 21 }] }, + { filename, code: 'function f(a: T) { a.trimStart(2) }', errors: [{ ...error(), column: 38 }] }, + { filename, code: "function f(a: T) { a.trimStart(2) }", errors: [{ ...error(), column: 41 }] }, + { filename, code: 'foo.trimStart(2)', errors: [{ ...error(), column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-string-raw.ts b/tests/src/rules/no-string-raw.ts new file mode 100644 index 00000000..c0c74be3 --- /dev/null +++ b/tests/src/rules/no-string-raw.ts @@ -0,0 +1,17 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-string-raw'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + column: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'String.raw' }, +}; + +new RuleTester().run('no-string-raw', rule, { + valid: ['String', 'String.fromCodePoint', 'let String = 0; String.raw'], + invalid: [{ code: 'String.raw', errors: [error] }], +}); diff --git a/tests/src/rules/no-subclassing-builtins.ts b/tests/src/rules/no-subclassing-builtins.ts new file mode 100644 index 00000000..8f471dcc --- /dev/null +++ b/tests/src/rules/no-subclassing-builtins.ts @@ -0,0 +1,34 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-subclassing-builtins'; + +const error = (name: string): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + column: 18 + name.length, + type: AST_NODE_TYPES.Identifier, + data: { name }, +}); + +new RuleTester().run('no-subclassing-builtins', rule, { + valid: [ + 'class MyObject extends Object {}', + 'let Array = 0; class MyArray extends Array {}', + 'class Array {}', + 'Array', + ], + invalid: [ + { code: 'class MyArray extends Array {}', errors: [error('Array')] }, + { code: 'class MyBoolean extends Boolean {}', errors: [error('Boolean')] }, + { code: 'class MyError extends Error {}', errors: [error('Error')] }, + { code: 'class MyRegExp extends RegExp {}', errors: [error('RegExp')] }, + { code: 'class MyFunction extends Function {}', errors: [error('Function')] }, + { code: 'class MyMap extends Map {}', errors: [error('Map')] }, + { code: 'class MyNumber extends Number {}', errors: [error('Number')] }, + { code: 'class MyPromise extends Promise {}', errors: [error('Promise')] }, + { code: 'class MySet extends Set {}', errors: [error('Set')] }, + { code: 'class MyString extends String {}', errors: [error('String')] }, + ], +}); diff --git a/tests/src/rules/no-symbol-prototype-description.ts b/tests/src/rules/no-symbol-prototype-description.ts new file mode 100644 index 00000000..3da524ef --- /dev/null +++ b/tests/src/rules/no-symbol-prototype-description.ts @@ -0,0 +1,65 @@ +import path from 'path'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-symbol-prototype-description'; + +const ruleId = 'no-symbol-prototype-description'; +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.MemberExpression, + data: { name: 'Symbol.prototype.description' }, +}; + +new RuleTester().run(ruleId, rule, { + valid: [ + 'foo.description', + 'Symbol.iterator.description', + 'Symbol().description', + { code: 'foo.description', options: [{ aggressive: false }], settings: { es: { aggressive: true } } }, + ], + invalid: [ + { code: 'foo.description', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + { + code: 'foo.description', + options: [{ aggressive: true }], + errors: [{ ...error, column: 1 }], + settings: { es: { aggressive: false } }, + }, + ], +}); + +// ----------------------------------------------------------------------------- +// TypeScript +// ----------------------------------------------------------------------------- +const parser = require.resolve('@typescript-eslint/parser'); +const tsconfigRootDir = path.resolve(__dirname, '../../fixtures'); +const project = 'tsconfig.json'; +const filename = path.join(tsconfigRootDir, 'test.ts'); + +new RuleTester({ parser }).run(`${ruleId} TS`, rule, { + valid: [ + { filename, code: 'foo.description' }, + + // `Symbol` is unknown type if tsconfig.json is not configured. + { filename, code: 'Symbol.iterator.description' }, + { filename, code: 'Symbol().description' }, + ], + invalid: [ + { filename, code: 'foo.description', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); + +new RuleTester({ + parser, + parserOptions: { tsconfigRootDir, project }, +}).run(`${ruleId} TS Full Type Information`, rule, { + valid: [{ filename, code: 'foo.description' }], + invalid: [ + { filename, code: 'Symbol.iterator.description', errors: [{ ...error, column: 1 }] }, + { filename, code: 'Symbol().description', errors: [{ ...error, column: 1 }] }, + { filename, code: 'let foo = Symbol(); foo.description', errors: [{ ...error, column: 21 }] }, + { filename, code: 'foo.description', errors: [{ ...error, column: 1 }], settings: { es: { aggressive: true } } }, + ], +}); diff --git a/tests/src/rules/no-symbol.ts b/tests/src/rules/no-symbol.ts new file mode 100644 index 00000000..eee8cb3a --- /dev/null +++ b/tests/src/rules/no-symbol.ts @@ -0,0 +1,14 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-symbol'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.Identifier, data: { name: 'Symbol' } }; + +new RuleTester().run('no-symbol', rule, { + valid: ['Array', 'Object', 'let Symbol = 0; Symbol'], + invalid: [ + { code: 'Symbol', errors: [{ ...error, column: 1 }] }, + { code: 'function f() { Symbol }', errors: [{ ...error, column: 16 }] }, + ], +}); diff --git a/tests/src/rules/no-template-literals.ts b/tests/src/rules/no-template-literals.ts new file mode 100644 index 00000000..32e9e500 --- /dev/null +++ b/tests/src/rules/no-template-literals.ts @@ -0,0 +1,52 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-template-literals'; + +const baseError = { messageId: 'forbidden' as const, line: 1, data: {} }; +const templateLiteralError = { ...baseError, type: AST_NODE_TYPES.TemplateLiteral }; +const taggedTemplateError = { ...baseError, type: AST_NODE_TYPES.TaggedTemplateExpression }; + +new RuleTester().run('no-template-literals', rule, { + valid: [ + "'foo'", + '"bar"', + ` +const a1 = "foo" +const a2 = "foo"+bar+"baz" + `, + ], + invalid: [ + { code: '`foo`', output: '"foo"', errors: [{ ...templateLiteralError, column: 1 }] }, + { code: 'tag`foo`', output: null, errors: [{ ...taggedTemplateError, column: 1 }] }, + // eslint-disable-next-line no-template-curly-in-string + { code: '`foo${a}bar${b}baz`', output: '"foo"+a+"bar"+b+"baz"', errors: [{ ...templateLiteralError, column: 1 }] }, + { + code: ` +const a1 = \`foo\` +const a2 = \`foo\${bar}baz\` +const a3 = tag\`foo\` + `, + output: ` +const a1 = "foo" +const a2 = "foo"+bar+"baz" +const a3 = tag\`foo\` + `, + errors: [ + { ...templateLiteralError, line: 2, column: 12 }, + { ...templateLiteralError, line: 3, column: 12 }, + { ...taggedTemplateError, line: 4, column: 12 }, + ], + }, + // eslint-disable-next-line no-template-curly-in-string + { code: '`${a}${b}`', output: '""+a+b', errors: [{ ...templateLiteralError, column: 1 }] }, + { code: '``', output: '""', errors: [{ ...templateLiteralError, column: 1 }] }, + // eslint-disable-next-line no-template-curly-in-string + { code: '`${""}`', output: '""', errors: [{ ...templateLiteralError, column: 1 }] }, + // eslint-disable-next-line no-template-curly-in-string + { code: "`${''}`", output: "''", errors: [{ ...templateLiteralError, column: 1 }] }, + { code: '`\n\t \'"\\`\\$\\${`', output: '"\\n\\t \'\\"`$${"', errors: [{ ...templateLiteralError, column: 1 }] }, + // eslint-disable-next-line no-template-curly-in-string + { code: "`${'abc'}`", output: "'abc'", errors: [{ ...templateLiteralError, column: 1 }] }, + ], +}); diff --git a/tests/src/rules/no-trailing-commas.ts b/tests/src/rules/no-trailing-commas.ts new file mode 100644 index 00000000..39914bdf --- /dev/null +++ b/tests/src/rules/no-trailing-commas.ts @@ -0,0 +1,24 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-trailing-commas'; + +const error = { messageId: 'forbidden' as const, line: 1, type: AST_NODE_TYPES.ObjectExpression, data: {} }; + +new RuleTester().run('no-trailing-commas', rule, { + valid: [ + 'var a = []', + 'var a = [a]', + 'var a = [a,b]', + 'var a = {}', + 'var a = {a}', + 'var a = {a,b}', + 'function f(a,) {}', + 'f(a,)', + ], + invalid: [ + { code: 'var a = [1,]', errors: [{ ...error, column: 9, type: AST_NODE_TYPES.ArrayExpression }] }, + { code: 'var obj = {a,}', errors: [{ ...error, column: 11 }] }, + { code: 'var obj = {a:1,}', errors: [{ ...error, column: 11 }] }, + ], +}); diff --git a/tests/src/rules/no-trailing-function-commas.ts b/tests/src/rules/no-trailing-function-commas.ts new file mode 100644 index 00000000..51e79d84 --- /dev/null +++ b/tests/src/rules/no-trailing-function-commas.ts @@ -0,0 +1,29 @@ +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-trailing-function-commas'; + +const error = { messageId: 'forbidden' as const, line: 1, data: {} }; + +new RuleTester().run('no-trailing-function-commas', rule, { + valid: [ + '[1,]', + '({a:1,})', + 'const [a,] = ary', + 'const {a,} = obj', + 'f()', + 'f(a)', + 'new F', + 'new F(a)', + 'function f() {}', + 'function f(a) {}', + ], + invalid: [ + { code: 'function f(a,) {}', output: 'function f(a) {}', errors: [{ ...error, column: 13 }] }, + { code: '(function(a,) {})', output: '(function(a) {})', errors: [{ ...error, column: 12 }] }, + { code: '(a,) => {}', output: '(a) => {}', errors: [{ ...error, column: 3 }] }, + { code: '({ f(a,) {} })', output: '({ f(a) {} })', errors: [{ ...error, column: 7 }] }, + { code: 'class A { f(a,) {} }', output: 'class A { f(a) {} }', errors: [{ ...error, column: 14 }] }, + { code: '(class { f(a,) {} })', output: '(class { f(a) {} })', errors: [{ ...error, column: 13 }] }, + { code: 'f(a,)', output: 'f(a)', errors: [{ ...error, column: 4 }] }, + { code: 'new F(a,)', output: 'new F(a)', errors: [{ ...error, column: 8 }] }, + ], +}); diff --git a/tests/src/rules/no-typed-arrays.ts b/tests/src/rules/no-typed-arrays.ts new file mode 100644 index 00000000..ad540ec7 --- /dev/null +++ b/tests/src/rules/no-typed-arrays.ts @@ -0,0 +1,28 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-typed-arrays'; + +const error = (name: string | 'DataView'): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: AST_NODE_TYPES.Identifier, + data: { name: name === 'DataView' ? name : `${name}Array` }, +}); + +new RuleTester().run('no-typed-arrays', rule, { + valid: ['Array', 'Set'], + invalid: [ + { code: 'Int8Array', errors: [error('Int8')] }, + { code: 'Uint8Array', errors: [error('Uint8')] }, + { code: 'Uint8ClampedArray', errors: [error('Uint8Clamped')] }, + { code: 'Int16Array', errors: [error('Int16')] }, + { code: 'Uint16Array', errors: [error('Uint16')] }, + { code: 'Int32Array', errors: [error('Int32')] }, + { code: 'Uint32Array', errors: [error('Uint32')] }, + { code: 'Float32Array', errors: [error('Float32')] }, + { code: 'Float64Array', errors: [error('Float64')] }, + { code: 'DataView', errors: [error('DataView')] }, + ], +}); diff --git a/tests/src/rules/no-unicode-codepoint-escapes.ts b/tests/src/rules/no-unicode-codepoint-escapes.ts new file mode 100644 index 00000000..e0ff93ba --- /dev/null +++ b/tests/src/rules/no-unicode-codepoint-escapes.ts @@ -0,0 +1,78 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-unicode-codepoint-escapes'; + +const baseError = { messageId: 'forbidden' as const, line: 1, data: {} }; +const identifierError = { ...baseError, type: AST_NODE_TYPES.Identifier }; +const literalError = { ...baseError, type: AST_NODE_TYPES.Literal }; +const templateError = { ...baseError, type: AST_NODE_TYPES.TemplateElement }; + +new RuleTester().run('no-unicode-codepoint-escapes', rule, { + valid: [ + 'foo = 1', + '\\u0045 = 1', + "'foo'", + "'\\u0045'", + "'u{20}'", + "'\\\\u{20}'", + '`foo`', + '`\\u0045`', + '`u{20}`', + '`\\\\u{20}`', + 'tag`\\unicode`', + 'tag`\\u{ZZZ}`', + ], + invalid: [ + { code: '\\u{45} = 1', output: '\\u0045 = 1', errors: [{ ...identifierError, column: 1 }] }, + { code: 'a\\u{45}b = 1', output: 'a\\u0045b = 1', errors: [{ ...identifierError, column: 2 }] }, + { code: "'\\u{45}'", output: "'\\u0045'", errors: [{ ...literalError, column: 2 }] }, + { code: "'a\\u{45}b'", output: "'a\\u0045b'", errors: [{ ...literalError, column: 3 }] }, + { code: '`\\u{45}`', output: '`\\u0045`', errors: [{ ...templateError, column: 2 }] }, + { code: 'tag`\\u{45}`', output: 'tag`\\u0045`', errors: [{ ...templateError, column: 5 }] }, + { + // eslint-disable-next-line no-template-curly-in-string + code: '`\\u{45}${a}\\u{46}`', + // eslint-disable-next-line no-template-curly-in-string + output: '`\\u0045${a}\\u0046`', + errors: [ + { ...templateError, column: 2 }, + { ...templateError, column: 12 }, + ], + }, + { + // eslint-disable-next-line no-template-curly-in-string + code: 'tag`\\u{45}${a}\\u{46}`', + // eslint-disable-next-line no-template-curly-in-string + output: 'tag`\\u0045${a}\\u0046`', + errors: [ + { ...templateError, column: 5 }, + { ...templateError, column: 15 }, + ], + }, + { + // eslint-disable-next-line no-template-curly-in-string + code: 'tag`\\u{XXXZX}${a}\\u{46}`', + // eslint-disable-next-line no-template-curly-in-string + output: 'tag`\\u{XXXZX}${a}\\u0046`', + errors: [{ ...templateError, column: 18 }], + }, + { code: '"\\u{20BB7}"', output: '"\\uD842\\uDFB7"', errors: [{ ...literalError, column: 2 }] }, + { code: '`\\u{20BB7}`', output: '`\\uD842\\uDFB7`', errors: [{ ...templateError, column: 2 }] }, + { + code: ` +a=\`\${a}\\u{D842}\\u{DFB7}\` +b="\\u{20BB7}" +`, + output: ` +a=\`\${a}\\uD842\\uDFB7\` +b="\\uD842\\uDFB7" +`, + errors: [ + { ...templateError, line: 2, column: 8, endLine: 2, endColumn: 16 }, + { ...templateError, line: 2, column: 16, endLine: 2, endColumn: 24 }, + { ...literalError, line: 3, column: 4, endLine: 3, endColumn: 13 }, + ], + }, + ], +}); diff --git a/tests/src/rules/no-weak-map.ts b/tests/src/rules/no-weak-map.ts new file mode 100644 index 00000000..5f9ae223 --- /dev/null +++ b/tests/src/rules/no-weak-map.ts @@ -0,0 +1,19 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-weak-map'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.Identifier, + data: { name: 'WeakMap' }, +}; + +new RuleTester().run('no-weak-map', rule, { + valid: ['Array', 'Object', 'let WeakMap = 0; WeakMap'], + invalid: [ + { code: 'WeakMap', errors: [{ ...error, column: 1 }] }, + { code: 'function f() { WeakMap }', errors: [{ ...error, column: 16 }] }, + ], +}); diff --git a/tests/src/rules/no-weak-set.ts b/tests/src/rules/no-weak-set.ts new file mode 100644 index 00000000..c629c3b0 --- /dev/null +++ b/tests/src/rules/no-weak-set.ts @@ -0,0 +1,19 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-weak-set'; + +const error = { + messageId: 'forbidden' as const, + line: 1, + type: AST_NODE_TYPES.Identifier, + data: { name: 'WeakSet' }, +}; + +new RuleTester().run('no-weak-set', rule, { + valid: ['Array', 'Object', 'let WeakSet = 0; WeakSet'], + invalid: [ + { code: 'WeakSet', errors: [{ ...error, column: 1 }] }, + { code: 'function f() { WeakSet }', errors: [{ ...error, column: 16 }] }, + ], +}); diff --git a/tests/src/rules/no-weakrefs.ts b/tests/src/rules/no-weakrefs.ts new file mode 100644 index 00000000..61a52d12 --- /dev/null +++ b/tests/src/rules/no-weakrefs.ts @@ -0,0 +1,22 @@ +import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import { RuleTester } from '../../tester'; +import rule from '../../../src/rules/no-weakrefs'; + +const error = (name: string): TSESLint.TestCaseError<'forbidden'> => ({ + messageId: 'forbidden', + line: 1, + type: AST_NODE_TYPES.Identifier, + data: { name }, +}); + +new RuleTester().run('no-weakrefs', rule, { + valid: ['Array', 'Object', 'let WeakRef = 0; WeakRef'], + invalid: [ + { code: 'WeakRef', errors: [{ ...error('WeakRef'), column: 1 }] }, + { code: 'function f() { WeakRef }', errors: [{ ...error('WeakRef'), column: 16 }] }, + { code: 'FinalizationRegistry', errors: [{ ...error('FinalizationRegistry'), column: 1 }] }, + { code: 'function f() { FinalizationRegistry }', errors: [{ ...error('FinalizationRegistry'), column: 16 }] }, + ], +}); diff --git a/tests/tester.ts b/tests/tester.ts new file mode 100644 index 00000000..eccc81f8 --- /dev/null +++ b/tests/tester.ts @@ -0,0 +1,28 @@ +import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { builtin } from 'globals'; +import semver from 'semver'; + +const eslintVersion = new TSESLint.Linter().version; +const getEcmaVersion = (): TSESLint.EcmaVersion => { + if (semver.gte(eslintVersion, '7.8.0')) { + return 2021; + } + + if (semver.gte(eslintVersion, '6.2.0')) { + return 2020; + } + + return semver.gte(eslintVersion, '5.0.0') ? 2019 : 2018; +}; +const ecmaVersion = getEcmaVersion(); + +console.log('ECMAScript Version: %d', ecmaVersion); + +export const RuleTester = TSESLint.RuleTester as typeof TSESLint.RuleTester & { + setDefaultConfig(config: Partial): void; + isSupported(targetEcmaVersion: number): boolean; +}; + +RuleTester.setDefaultConfig({ parserOptions: { ecmaVersion, sourceType: 'script' }, globals: builtin }); + +RuleTester.isSupported = (targetEcmaVersion) => targetEcmaVersion <= ecmaVersion; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..a72745a5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.prod.json", + "compilerOptions": { + "noEmit": true + }, + "exclude": ["**/dist/**/*"], + "include": [ + "scripts/*.ts", + "src/**/*.ts", + "tests/**/*.ts", + "index.ts", + ".eslintrc.js", + ".prettierrc.js", + "commitlint.config.js" + ] +} diff --git a/tsconfig.prod.json b/tsconfig.prod.json new file mode 100644 index 00000000..c6e210f2 --- /dev/null +++ b/tsconfig.prod.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "allowJs": true, + "declaration": true, + "strict": true, + "noImplicitAny": false, + "moduleResolution": "node", + "esModuleInterop": true, + "preserveSymlinks": true, + "resolveJsonModule": true + }, + "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/__tests__", "**/dist/**/*"], + "include": ["src/**/*", "index.ts", "base.ts", "playwright.ts", "type-checking.ts", ".eslintrc.ts"] +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..81198082 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4307 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" + integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== + dependencies: + "@babel/highlight" "^7.16.0" + +"@babel/compat-data@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.0.tgz#ea269d7f78deb3a7826c39a4048eecda541ebdaa" + integrity sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew== + +"@babel/core@^7.12.16", "@babel/core@^7.7.5": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" + integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" + "@babel/helper-module-transforms" "^7.16.0" + "@babel/helpers" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + +"@babel/eslint-parser@^7.12.16": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.16.0.tgz#032cf6c8d844a95ad62f779d2708fb4f77e1a81c" + integrity sha512-c+AsYOHjI+FgCa+ifLd8sDXp4U4mjkfFgL9NdQWhuA731kAUJs0WdJIXET4A14EJAR9Jv9FFF/MzPWJfV9Oirw== + dependencies: + eslint-scope "^5.1.1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + +"@babel/generator@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" + integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== + dependencies: + "@babel/types" "^7.16.0" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/helper-compilation-targets@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.0.tgz#01d615762e796c17952c29e3ede9d6de07d235a8" + integrity sha512-S7iaOT1SYlqK0sQaCi21RX4+13hmdmnxIEAnQUB/eh7GeAnRjOUgTYpLkUOiRXzD+yog1JxP0qyAQZ7ZxVxLVg== + dependencies: + "@babel/compat-data" "^7.16.0" + "@babel/helper-validator-option" "^7.14.5" + browserslist "^4.16.6" + semver "^6.3.0" + +"@babel/helper-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" + integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== + dependencies: + "@babel/helper-get-function-arity" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/helper-get-function-arity@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" + integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-hoist-variables@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" + integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-member-expression-to-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" + integrity sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-module-imports@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" + integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-module-transforms@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" + integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== + dependencies: + "@babel/helper-module-imports" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-simple-access" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/helper-validator-identifier" "^7.15.7" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/helper-optimise-call-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" + integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-replace-supers@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz#73055e8d3cf9bcba8ddb55cad93fedc860f68f17" + integrity sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/helper-simple-access@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" + integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-split-export-declaration@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" + integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": + version "7.15.7" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== + +"@babel/helper-validator-option@^7.14.5": + version "7.14.5" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + +"@babel/helpers@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.0.tgz#875519c979c232f41adfbd43a3b0398c2e388183" + integrity sha512-dVRM0StFMdKlkt7cVcGgwD8UMaBfWJHl3A83Yfs8GQ3MO0LHIIIMvK7Fa0RGOGUQ10qikLaX6D7o5htcQWgTMQ== + dependencies: + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/highlight@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" + integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== + dependencies: + "@babel/helper-validator-identifier" "^7.15.7" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.16.0": + version "7.16.2" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.16.2.tgz#3723cd5c8d8773eef96ce57ea1d9b7faaccd12ac" + integrity sha512-RUVpT0G2h6rOZwqLDTrKk7ksNv7YpAilTnYe1/Q+eDjxEceRMKVWbCsX7t8h6C1qCFi/1Y8WZjcEPBAFG27GPw== + +"@babel/runtime@^7.10.4", "@babel/runtime@^7.5.5": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.0.tgz#e27b977f2e2088ba24748bf99b5e1dece64e4f0b" + integrity sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw== + dependencies: + regenerator-runtime "^0.13.4" + +"@babel/template@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" + integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/traverse@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.0.tgz#965df6c6bfc0a958c1e739284d3c9fa4a6e3c45b" + integrity sha512-qQ84jIs1aRQxaGaxSysII9TuDaguZ5yVrEuC0BN2vcPlalwfLovVmCjbFDPECPXcYM/wLvNFfp8uDOliLxIoUQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.16.0": + version "7.16.0" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" + integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== + dependencies: + "@babel/helper-validator-identifier" "^7.15.7" + to-fast-properties "^2.0.0" + +"@changesets/apply-release-plan@^5.0.2": + version "5.0.2" + resolved "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-5.0.2.tgz#8abcbbce338a0ac10d67b1cc777b0b893b452198" + integrity sha512-grNaIzOjAd34VV5493hyL7a9Y5P2v0dLXWaSfcUUIREemzkkpuVtsqAQRtot2JIjOcpGMyTn3tnaMpErJ1ZByw== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/config" "^1.6.2" + "@changesets/get-version-range-type" "^0.3.2" + "@changesets/git" "^1.2.0" + "@changesets/types" "^4.0.1" + "@manypkg/get-packages" "^1.0.1" + detect-indent "^6.0.0" + fs-extra "^7.0.1" + lodash.startcase "^4.4.0" + outdent "^0.5.0" + prettier "^1.19.1" + resolve-from "^5.0.0" + semver "^5.4.1" + +"@changesets/assemble-release-plan@^5.0.2": + version "5.0.2" + resolved "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.0.2.tgz#81063d2e01f967851063f5689f80374aa35175e9" + integrity sha512-4Q7w0ZeeNCv6sxUywL2bc8D2id9nyq2SB0LK+WY6ocg9/m4b3giKcbcGYxczgFbJvdcgxowqXPPAyETI9RpqBg== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/errors" "^0.1.4" + "@changesets/get-dependents-graph" "^1.2.3" + "@changesets/types" "^4.0.1" + "@manypkg/get-packages" "^1.0.1" + semver "^5.4.1" + +"@changesets/changelog-github@0.4.1": + version "0.4.1" + resolved "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.4.1.tgz#880cb624477972ea103abf6942cf4ee3106f682b" + integrity sha512-WK9DzS3i0wa2doEnOr4sm/FMnNtxzCCAKP7dEcWvhYkgXYX5R6jmfHAcDstmjAhiuvbhoHYom4MOC1tIzgwnfA== + dependencies: + "@changesets/get-github-info" "^0.5.0" + "@changesets/types" "^4.0.1" + dotenv "^8.1.0" + +"@changesets/cli@2.18.0": + version "2.18.0" + resolved "https://registry.npmjs.org/@changesets/cli/-/cli-2.18.0.tgz#662e27c78897cf948ca61177df9c915d750b8221" + integrity sha512-WJj0g0BvTxsVfAnHJrOTORRTTP6CG5yT4gxVGW3og8B1SquEwL3KhIXIbpA+o3BnkBlm/hRoIrkRivrgX7GOJA== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/apply-release-plan" "^5.0.2" + "@changesets/assemble-release-plan" "^5.0.2" + "@changesets/config" "^1.6.2" + "@changesets/errors" "^0.1.4" + "@changesets/get-dependents-graph" "^1.2.3" + "@changesets/get-release-plan" "^3.0.2" + "@changesets/git" "^1.2.0" + "@changesets/logger" "^0.0.5" + "@changesets/pre" "^1.0.7" + "@changesets/read" "^0.5.1" + "@changesets/types" "^4.0.1" + "@changesets/write" "^0.1.5" + "@manypkg/get-packages" "^1.0.1" + "@types/semver" "^6.0.0" + boxen "^1.3.0" + chalk "^2.1.0" + enquirer "^2.3.0" + external-editor "^3.1.0" + fs-extra "^7.0.1" + human-id "^1.0.2" + is-ci "^2.0.0" + meow "^6.0.0" + outdent "^0.5.0" + p-limit "^2.2.0" + preferred-pm "^3.0.0" + semver "^5.4.1" + spawndamnit "^2.0.0" + term-size "^2.1.0" + tty-table "^2.8.10" + +"@changesets/config@^1.6.2": + version "1.6.2" + resolved "https://registry.npmjs.org/@changesets/config/-/config-1.6.2.tgz#42ade5ec516560e33698f207804b3560223ea334" + integrity sha512-CJV71tDz/A4TmpyYRIdT4pwGg0GWuem7ahNR01VnOHhmXoXFbXrISX1TYGYo611N7vO9RQHmV8cnhmlHU0LlNA== + dependencies: + "@changesets/errors" "^0.1.4" + "@changesets/get-dependents-graph" "^1.2.3" + "@changesets/logger" "^0.0.5" + "@changesets/types" "^4.0.1" + "@manypkg/get-packages" "^1.0.1" + fs-extra "^7.0.1" + micromatch "^4.0.2" + +"@changesets/errors@^0.1.4": + version "0.1.4" + resolved "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz#f79851746c43679a66b383fdff4c012f480f480d" + integrity sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q== + dependencies: + extendable-error "^0.1.5" + +"@changesets/get-dependents-graph@^1.2.3": + version "1.2.3" + resolved "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.2.3.tgz#593c292cd4a1543606817d818f0d8c753ac26411" + integrity sha512-+Fyf+L+4rck9au5zIZcIJX+8zBMGRdgZwD5DGGt37hP011R/46fahnpJ6imNB9cV+HTMNX/QMAFrkWqt1hy73A== + dependencies: + "@changesets/types" "^4.0.1" + "@manypkg/get-packages" "^1.0.1" + chalk "^2.1.0" + fs-extra "^7.0.1" + semver "^5.4.1" + +"@changesets/get-github-info@^0.5.0": + version "0.5.0" + resolved "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.0.tgz#b91ceb2d82edef78ae1598ea9fc335a012250295" + integrity sha512-vm5VgHwrxkMkUjFyn3UVNKLbDp9YMHd3vMf1IyJoa/7B+6VpqmtAaXyDS0zBLfN5bhzVCHrRnj4GcZXXcqrFTw== + dependencies: + dataloader "^1.4.0" + node-fetch "^2.5.0" + +"@changesets/get-release-plan@^3.0.2": + version "3.0.2" + resolved "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.2.tgz#7e5b264838032b226263f8bfeff4706c255f6d4f" + integrity sha512-jAWHQfaDOUKEcrnx6GZyYM7oKmbI+vQ+wbYowIeYpiojprQC0P7I6asbzk4fpGM2xyzP4EjRMErRGH91VVzBSg== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/assemble-release-plan" "^5.0.2" + "@changesets/config" "^1.6.2" + "@changesets/pre" "^1.0.7" + "@changesets/read" "^0.5.1" + "@changesets/types" "^4.0.1" + "@manypkg/get-packages" "^1.0.1" + +"@changesets/get-version-range-type@^0.3.2": + version "0.3.2" + resolved "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz#8131a99035edd11aa7a44c341cbb05e668618c67" + integrity sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg== + +"@changesets/git@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@changesets/git/-/git-1.2.0.tgz#9b6c4bcf101ecf2f870df6771bb1ca12d863984e" + integrity sha512-9EM+04/6TIImnNTgagxrwtimITtHEDaBYKubPPA6WDzd+KiTOf9g7i/6aUhhdwbwqQQfPAn5gzgfFB0KvwEHeA== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/errors" "^0.1.4" + "@changesets/types" "^4.0.1" + "@manypkg/get-packages" "^1.0.1" + is-subdir "^1.1.1" + spawndamnit "^2.0.0" + +"@changesets/logger@^0.0.5": + version "0.0.5" + resolved "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz#68305dd5a643e336be16a2369cb17cdd8ed37d4c" + integrity sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw== + dependencies: + chalk "^2.1.0" + +"@changesets/parse@^0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.9.tgz#c518792b05f15ab418d58dc1cea81601556e845e" + integrity sha512-XoTEkMpvRRVxSlhvOaK4YSFM+RZhYFTksxRh7ieNkb6pMxkpq8MOYSi/07BuqkODn4dJEMOoSy3RzL99P6FyqA== + dependencies: + "@changesets/types" "^4.0.1" + js-yaml "^3.13.1" + +"@changesets/pre@^1.0.7": + version "1.0.7" + resolved "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.7.tgz#caf6430c90b8ac6d58c9cd90a19558ab06b19b88" + integrity sha512-oUU6EL4z0AIyCv/EscQFxxJsQfc9/AcSpqAGbdZrLXwshUWTXsJHMWlE3/+iSIyQ+I+/xtxbBxnqDUpUU3TOOg== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/errors" "^0.1.4" + "@changesets/types" "^4.0.1" + "@manypkg/get-packages" "^1.0.1" + fs-extra "^7.0.1" + +"@changesets/read@^0.5.1": + version "0.5.1" + resolved "https://registry.npmjs.org/@changesets/read/-/read-0.5.1.tgz#89635bf2b84e5fd5d49e1d685adb9c47b5e679a1" + integrity sha512-QJ3rVS+L0Y3yLk3cAOglNh4tuMUfQl8cJjyAnNnJHS9nCXZUiZjYiJc+34XpZT5vUb+4+0FY1wWtzlkAKuLR2g== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/git" "^1.2.0" + "@changesets/logger" "^0.0.5" + "@changesets/parse" "^0.3.9" + "@changesets/types" "^4.0.1" + chalk "^2.1.0" + fs-extra "^7.0.1" + p-filter "^2.1.0" + +"@changesets/types@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@changesets/types/-/types-4.0.1.tgz#85cf3cc32baff0691112d9d15fc21fbe022c9f0a" + integrity sha512-zVfv752D8K2tjyFmxU/vnntQ+dPu+9NupOSguA/2Zuym4tVxRh0ylArgKZ1bOAi2eXfGlZMxJU/kj7uCSI15RQ== + +"@changesets/write@^0.1.5": + version "0.1.5" + resolved "https://registry.npmjs.org/@changesets/write/-/write-0.1.5.tgz#97574d95c8e48c3bbb1173802672f9a64d1b7fef" + integrity sha512-AYVSCH7on/Cyzo/8lVfqlsXmyKl3JhbNu9yHApdLPhHAzv5wqoHiZlMDkmd+AA67SRqzK2lDs4BcIojK+uWeIA== + dependencies: + "@babel/runtime" "^7.10.4" + "@changesets/types" "^4.0.1" + fs-extra "^7.0.1" + human-id "^1.0.2" + prettier "^1.19.1" + +"@commitlint/cli@14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/cli/-/cli-14.1.0.tgz#7b657a955ed22f3df348ba9afa6ce5a5121ff7eb" + integrity sha512-Orq62jkl9qAGvjFqhehtAqjGY/duJ8hIRPPIHmGR2jIB96D4VTmazS3ZvqJz2Q9kKr61mLAk/171zm0FVzQCYA== + dependencies: + "@commitlint/format" "^14.1.0" + "@commitlint/lint" "^14.1.0" + "@commitlint/load" "^14.1.0" + "@commitlint/read" "^14.0.0" + "@commitlint/types" "^14.0.0" + lodash "^4.17.19" + resolve-from "5.0.0" + resolve-global "1.0.0" + yargs "^17.0.0" + +"@commitlint/config-conventional@14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-14.1.0.tgz#29e386ef200fa72d43418153ab1c490c89024dee" + integrity sha512-JuhCqkEv8jyqmd54EpXPsQFpYc/8k7sfP1UziRdEvZSJUCLxz+8Pk4cNS0oF1BtjaWO7ITgXPlIZg47PyApGmg== + dependencies: + conventional-changelog-conventionalcommits "^4.3.1" + +"@commitlint/ensure@^14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/ensure/-/ensure-14.1.0.tgz#b58b2ffe2bc95be143ed8f188721b97df1043ba5" + integrity sha512-xrYvFdqVepT3XA1BmSh88eKbvYKtLuQu98QLfgxVmwS99Kj3yW0sT3D7jGvNsynbIx2dhbXofDyubf/DKkpFrQ== + dependencies: + "@commitlint/types" "^14.0.0" + lodash "^4.17.19" + +"@commitlint/execute-rule@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-14.0.0.tgz#3ba45fc255286e3180f89ed4e9ac1ef237160734" + integrity sha512-Hh/HLpCBDlrD3Rx2x2pDBx6CU+OtVqGXh7mbFpNihAVx6B0zyZqm/vv0cdwdhfGW5OEn1BhCqHf1ZOvL/DwdWA== + +"@commitlint/format@^14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/format/-/format-14.1.0.tgz#09b4081bdcb02163496bfcece98f9d4606238bc5" + integrity sha512-sF6engqqHjvxGctWRKjFs/HQeNowlpbVmmoP481b2UMQnVQnjjfXJvQsoLpaqFUvgc2sHM4L85F8BmAw+iHG1w== + dependencies: + "@commitlint/types" "^14.0.0" + chalk "^4.0.0" + +"@commitlint/is-ignored@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-14.0.0.tgz#8c88e05211519bc187558aad07eee02581292ec4" + integrity sha512-nJltYjXTa+mk+6SPe35nOZCCvt3Gh5mbDz008KQ4OPcn1GX1NG+pEgz1Kx3agDp/pc+JGnsrr5GV00gygIoloA== + dependencies: + "@commitlint/types" "^14.0.0" + semver "7.3.5" + +"@commitlint/lint@^14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/lint/-/lint-14.1.0.tgz#1673b216803d65cc4bbe631f656125be54fd2f69" + integrity sha512-CApGJEOtWU/CcuPD8HkOR1jdUYpjKutGPaeby9nSFzJhwl/UQOjxc4Nd+2g2ygsMi5l3N4j2sWQYEgccpFC3lA== + dependencies: + "@commitlint/is-ignored" "^14.0.0" + "@commitlint/parse" "^14.0.0" + "@commitlint/rules" "^14.1.0" + "@commitlint/types" "^14.0.0" + +"@commitlint/load@^14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/load/-/load-14.1.0.tgz#911e8625cfa1a80df2914b835834c6068fdfdab4" + integrity sha512-p+HbgjhkqLsnxyjOUdEYHztHCp8n2oLVUJTmRPuP5FXLNevh6Gwmxf+NYC2J0sgD084aV2CFi3qu1W4yHWIknA== + dependencies: + "@commitlint/execute-rule" "^14.0.0" + "@commitlint/resolve-extends" "^14.1.0" + "@commitlint/types" "^14.0.0" + "@endemolshinegroup/cosmiconfig-typescript-loader" "^3.0.2" + chalk "^4.0.0" + cosmiconfig "^7.0.0" + lodash "^4.17.19" + resolve-from "^5.0.0" + typescript "^4.4.3" + +"@commitlint/message@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/message/-/message-14.0.0.tgz#4db852fcd76352be547811d57709667588a39ba9" + integrity sha512-316Pum+bwDcZamOQw0DXSY17Dq9EjvL1zKdYIZqneu4lnXN6uFfi53Y/sP5crW6zlLdnuTHe1MnuewXPLHfH1Q== + +"@commitlint/parse@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/parse/-/parse-14.0.0.tgz#cb6f66323a27617744f9b479cf09941ff9c3f93d" + integrity sha512-49qkk0TcwdxJPZUX8MElEzMlRFIL/cg64P4pk8HotFEm2HYdbxxZp6v3cbVw5WOsnRA0frrs+NNoOcIT83ccMQ== + dependencies: + "@commitlint/types" "^14.0.0" + conventional-changelog-angular "^5.0.11" + conventional-commits-parser "^3.2.2" + +"@commitlint/read@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/read/-/read-14.0.0.tgz#f871600ce815b541c7f1a4fdabe2c66d8840c2ab" + integrity sha512-WXXcSLBqwXTqnEmB0lbU2TrayDJ2G3qI/lxy1ianVmpQol8p9BjodAA6bYxtYYHdQFVXUrIsclzFP/naWG+hlQ== + dependencies: + "@commitlint/top-level" "^14.0.0" + "@commitlint/types" "^14.0.0" + fs-extra "^10.0.0" + git-raw-commits "^2.0.0" + +"@commitlint/resolve-extends@^14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-14.1.0.tgz#f23b40d95c95901fcb7b53edebc8fe86f54fe99d" + integrity sha512-ko80k6QB6E6/OvGNWy4u7gzzWyluDT3VDNL2kfZaDywsnrYntUKyT4Do97gQ7orttITzj2GRtk3KWClVz4rUUQ== + dependencies: + import-fresh "^3.0.0" + lodash "^4.17.19" + resolve-from "^5.0.0" + resolve-global "^1.0.0" + +"@commitlint/rules@^14.1.0": + version "14.1.0" + resolved "https://registry.npmjs.org/@commitlint/rules/-/rules-14.1.0.tgz#caec339b05c45e7536cac5d9f1db11fcc9e3dfcd" + integrity sha512-6jmv414/1JzGzDI/DS+snAMhcL6roQKPdg0WB3kWTWN52EvWXBFm0HIMGt2H/FlRKxozwVXlQN60/1fNIl98xA== + dependencies: + "@commitlint/ensure" "^14.1.0" + "@commitlint/message" "^14.0.0" + "@commitlint/to-lines" "^14.0.0" + "@commitlint/types" "^14.0.0" + execa "^5.0.0" + +"@commitlint/to-lines@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-14.0.0.tgz#d90c7453bc678e7e2d8a4cae125783b1d4df7aa4" + integrity sha512-uIXk54oJDuYyLpI208s3+cGmJ323yvSJ9LB7yUDMWUeJi2LgRxE2EBZL995kLQdnoAsBBXcLq+VDyppg5bV/cg== + +"@commitlint/top-level@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/top-level/-/top-level-14.0.0.tgz#5fed6ac7ae2f5cff02ea1f41bddbfa24487ef3c8" + integrity sha512-MZDKZfWfl9g4KozgWBGTCrI2cXkMHnBFlhwvEfrAu5G8wd5aL1f2uWEUMnBMjUikmhVj99i1pzge4XFWHQ29wQ== + dependencies: + find-up "^5.0.0" + +"@commitlint/types@^14.0.0": + version "14.0.0" + resolved "https://registry.npmjs.org/@commitlint/types/-/types-14.0.0.tgz#17bf4d1ab1178c67990ce01b36017d6e6792b751" + integrity sha512-sIls1nP2uSbGL466edYlh8mn7O/WP4i3bcvP+2DMhkscRCSgaPhNRWDilhYVsHt2Vu1HTQ27uT0Bj5/Lt2+EcQ== + dependencies: + chalk "^4.0.0" + +"@endemolshinegroup/cosmiconfig-typescript-loader@^3.0.2": + version "3.0.2" + resolved "https://registry.npmjs.org/@endemolshinegroup/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-3.0.2.tgz#eea4635828dde372838b0909693ebd9aafeec22d" + integrity sha512-QRVtqJuS1mcT56oHpVegkKBlgtWjXw/gHNWO3eL9oyB5Sc7HBoc2OLG/nYpVfT/Jejvo3NUrD0Udk7XgoyDKkA== + dependencies: + lodash.get "^4" + make-error "^1" + ts-node "^9" + tslib "^2" + +"@eslint/eslintrc@^1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.4.tgz#dfe0ff7ba270848d10c5add0715e04964c034b31" + integrity sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.0.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +"@humanwhocodes/config-array@^0.6.0": + version "0.6.0" + resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz#b5621fdb3b32309d2d16575456cbc277fa8f021a" + integrity sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@manypkg/find-root@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz#a62d8ed1cd7e7d4c11d9d52a8397460b5d4ad29f" + integrity sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA== + dependencies: + "@babel/runtime" "^7.5.5" + "@types/node" "^12.7.1" + find-up "^4.1.0" + fs-extra "^8.1.0" + +"@manypkg/get-packages@^1.0.1": + version "1.1.2" + resolved "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-1.1.2.tgz#d0af46018966dbe064103472b3dae9662bf2ea71" + integrity sha512-AoA/VBOik2YZh+z44YlK/wgEA5lbzd5pfGsjjaGFuAjUXe0+zBL6oK3ryOK3pDkV7SljyN0sLpVeLBLKc3LeVA== + dependencies: + "@babel/runtime" "^7.5.5" + "@changesets/types" "^4.0.1" + "@manypkg/find-root" "^1.1.0" + fs-extra "^8.1.0" + globby "^11.0.0" + read-yaml-file "^1.1.0" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@types/eslint@7.28.2": + version "7.28.2" + resolved "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.2.tgz#0ff2947cdd305897c52d5372294e8c76f351db68" + integrity sha512-KubbADPkfoU75KgKeKLsFHXnU4ipH7wYg0TRT33NK3N3yiu7jlFAAoygIWBV+KbuHx/G+AvuGX6DllnK35gfJA== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*": + version "0.0.50" + resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + +"@types/is-core-module@2.2.0": + version "2.2.0" + resolved "https://registry.npmjs.org/@types/is-core-module/-/is-core-module-2.2.0.tgz#a6f01308db449fb9200cc8b8b05aa26f404f0ddb" + integrity sha512-4jdbEoadP1B6v5/6YoVFPKUr2NC+knEWMSllpX3cL4FAZktVmveeWTcUHQY7bU6Vx8TEt/ARbQyQapkZvGgFog== + +"@types/json-schema@*", "@types/json-schema@^7.0.9": + version "7.0.9" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + +"@types/minimatch@3.0.5": + version "3.0.5" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== + +"@types/minimist@^1.2.0": + version "1.2.2" + resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" + integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== + +"@types/node@^12.7.1": + version "12.20.36" + resolved "https://registry.npmjs.org/@types/node/-/node-12.20.36.tgz#5bd54d2383e714fc4d2c258107ee70c5bad86d0c" + integrity sha512-+5haRZ9uzI7rYqzDznXgkuacqb6LJhAti8mzZKWxIXn/WEtvB+GHVJ7AuMwcN1HMvXOSJcrvA6PPoYHYOYYebA== + +"@types/normalize-package-data@^2.4.0": + version "2.4.1" + resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" + integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== + +"@types/parse-json@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" + integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + +"@types/resolve@1.20.1": + version "1.20.1" + resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.1.tgz#3727e48042fda81e374f5d5cf2fa92288bf698f8" + integrity sha512-Ku5+GPFa12S3W26Uwtw+xyrtIpaZsGYHH6zxNbZlstmlvMYSZRzOwzwsXbxlVUbHyUucctSyuFtu6bNxwYomIw== + +"@types/semver@7.3.9": + version "7.3.9" + resolved "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" + integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ== + +"@types/semver@^6.0.0": + version "6.2.3" + resolved "https://registry.npmjs.org/@types/semver/-/semver-6.2.3.tgz#5798ecf1bec94eaa64db39ee52808ec0693315aa" + integrity sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A== + +"@typescript-eslint/eslint-plugin@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.3.1.tgz#d8ff412f10f54f6364e7fd7c1e70eb6767f434c3" + integrity sha512-cFImaoIr5Ojj358xI/SDhjog57OK2NqlpxwdcgyxDA3bJlZcJq5CPzUXtpD7CxI2Hm6ATU7w5fQnnkVnmwpHqw== + dependencies: + "@typescript-eslint/experimental-utils" "5.3.1" + "@typescript-eslint/scope-manager" "5.3.1" + debug "^4.3.2" + functional-red-black-tree "^1.0.1" + ignore "^5.1.8" + regexpp "^3.2.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@5.3.0": + version "5.3.0" + resolved "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.3.0.tgz#ee56b4957547ed2b0fc7451205e41502e664f546" + integrity sha512-NFVxYTjKj69qB0FM+piah1x3G/63WB8vCBMnlnEHUsiLzXSTWb9FmFn36FD9Zb4APKBLY3xRArOGSMQkuzTF1w== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.3.0" + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/typescript-estree" "5.3.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/experimental-utils@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.3.1.tgz#bbd8f9b67b4d5fdcb9d2f90297d8fcda22561e05" + integrity sha512-RgFn5asjZ5daUhbK5Sp0peq0SSMytqcrkNfU4pnDma2D8P3ElZ6JbYjY8IMSFfZAJ0f3x3tnO3vXHweYg0g59w== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.3.1" + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/typescript-estree" "5.3.1" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.3.1.tgz#8ff1977c3d3200c217b3e4628d43ef92f89e5261" + integrity sha512-TD+ONlx5c+Qhk21x9gsJAMRohWAUMavSOmJgv3JGy9dgPhuBd5Wok0lmMClZDyJNLLZK1JRKiATzCKZNUmoyfw== + dependencies: + "@typescript-eslint/scope-manager" "5.3.1" + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/typescript-estree" "5.3.1" + debug "^4.3.2" + +"@typescript-eslint/scope-manager@5.3.0": + version "5.3.0" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.3.0.tgz#97d0ccc7c9158e89e202d5e24ce6ba49052d432e" + integrity sha512-22Uic9oRlTsPppy5Tcwfj+QET5RWEnZ5414Prby465XxQrQFZ6nnm5KnXgnsAJefG4hEgMnaxTB3kNEyjdjj6A== + dependencies: + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/visitor-keys" "5.3.0" + +"@typescript-eslint/scope-manager@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.3.1.tgz#3cfbfbcf5488fb2a9a6fbbe97963ee1e8d419269" + integrity sha512-XksFVBgAq0Y9H40BDbuPOTUIp7dn4u8oOuhcgGq7EoDP50eqcafkMVGrypyVGvDYHzjhdUCUwuwVUK4JhkMAMg== + dependencies: + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" + +"@typescript-eslint/types@5.3.0": + version "5.3.0" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.3.0.tgz#af29fd53867c2df0028c57c36a655bd7e9e05416" + integrity sha512-fce5pG41/w8O6ahQEhXmMV+xuh4+GayzqEogN24EK+vECA3I6pUwKuLi5QbXO721EMitpQne5VKXofPonYlAQg== + +"@typescript-eslint/types@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.3.1.tgz#afaa715b69ebfcfde3af8b0403bf27527912f9b7" + integrity sha512-bG7HeBLolxKHtdHG54Uac750eXuQQPpdJfCYuw4ZI3bZ7+GgKClMWM8jExBtp7NSP4m8PmLRM8+lhzkYnSmSxQ== + +"@typescript-eslint/typescript-estree@5.3.0": + version "5.3.0" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.0.tgz#4f68ddd46dc2983182402d2ab21fb44ad94988cf" + integrity sha512-FJ0nqcaUOpn/6Z4Jwbtf+o0valjBLkqc3MWkMvrhA2TvzFXtcclIM8F4MBEmYa2kgcI8EZeSAzwoSrIC8JYkug== + dependencies: + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/visitor-keys" "5.3.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/typescript-estree@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.1.tgz#50cc4bfb93dc31bc75e08ae52e29fcb786d606ec" + integrity sha512-PwFbh/PKDVo/Wct6N3w+E4rLZxUDgsoII/GrWM2A62ETOzJd4M6s0Mu7w4CWsZraTbaC5UQI+dLeyOIFF1PquQ== + dependencies: + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@5.3.0": + version "5.3.0" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.0.tgz#a6258790f3b7b2547f70ed8d4a1e0c3499994523" + integrity sha512-oVIAfIQuq0x2TFDNLVavUn548WL+7hdhxYn+9j3YdJJXB7mH9dAmZNJsPDa7Jc+B9WGqoiex7GUDbyMxV0a/aw== + dependencies: + "@typescript-eslint/types" "5.3.0" + eslint-visitor-keys "^3.0.0" + +"@typescript-eslint/visitor-keys@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.1.tgz#c2860ff22939352db4f3806f34b21d8ad00588ba" + integrity sha512-3cHUzUuVTuNHx0Gjjt5pEHa87+lzyqOiHXy/Gz+SJOCW1mpw9xQHIIEwnKn+Thph1mgWyZ90nboOcSuZr/jTTQ== + dependencies: + "@typescript-eslint/types" "5.3.1" + eslint-visitor-keys "^3.0.0" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + +JSONStream@^1.0.4: + version "1.3.5" + resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +acorn-jsx@^5.3.1: + version "5.3.2" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.5.0: + version "8.5.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + 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@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= + dependencies: + string-width "^2.0.0" + +ansi-colors@4.1.1, ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +append-transform@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz#99d9d29c7b38391e6f428d28ce136551f0b77e12" + integrity sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg== + dependencies: + default-require-extensions "^3.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-ify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= + +array-includes@^3.1.4: + version "3.1.4" + resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" + integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + get-intrinsic "^1.1.1" + is-string "^1.0.7" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array.prototype.flat@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" + integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +better-path-resolve@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz#13a35a1104cdd48a7b74bf8758f96a1ee613f99d" + integrity sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g== + dependencies: + is-windows "^1.0.0" + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +boxen@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^2.0.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^1.2.0" + widest-line "^2.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.1, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +breakword@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/breakword/-/breakword-1.0.5.tgz#fd420a417f55016736b5b615161cae1c8f819810" + integrity sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg== + dependencies: + wcwidth "^1.0.1" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserslist@^4.16.6: + version "4.17.6" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.17.6.tgz#c76be33e7786b497f66cad25a73756c8b938985d" + integrity sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw== + dependencies: + caniuse-lite "^1.0.30001274" + electron-to-chromium "^1.3.886" + escalade "^3.1.1" + node-releases "^2.0.1" + picocolors "^1.0.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +builtin-modules@^3.0.0: + version "3.2.0" + resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" + integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== + +caching-transform@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz#00d297a4206d71e2163c39eaffa8157ac0651f0f" + integrity sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA== + dependencies: + hasha "^5.0.0" + make-dir "^3.0.0" + package-hash "^4.0.0" + write-file-atomic "^3.0.0" + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase-keys@^6.2.2: + version "6.2.2" + resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" + integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== + dependencies: + camelcase "^5.3.1" + map-obj "^4.0.0" + quick-lru "^4.0.1" + +camelcase@6.2.0, camelcase@^6.0.0: + version "6.2.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" + integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + +camelcase@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + +camelcase@^5.0.0, camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +caniuse-lite@^1.0.30001274: + version "1.0.30001274" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001274.tgz#26ca36204d15b17601ba6fc35dbdad950a647cc7" + integrity sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew== + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +chokidar@3.5.2: + version "3.5.2" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +ci-info@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" + integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== + +clean-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7" + integrity sha1-jffHquUf02h06PjQW5GAvBGj/tc= + dependencies: + escape-string-regexp "^1.0.5" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= + +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-truncate@2.1.0, cli-truncate@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" + integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== + dependencies: + slice-ansi "^3.0.0" + string-width "^4.2.0" + +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colorette@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" + integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== + +colorette@^2.0.16: + version "2.0.16" + resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== + +commander@^6.1.0: + version "6.2.1" + resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== + +commander@^8.2.0: + version "8.3.0" + resolved "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + +compare-func@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" + integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== + dependencies: + array-ify "^1.0.0" + dot-prop "^5.1.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +conventional-changelog-angular@^5.0.11: + version "5.0.13" + resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" + integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== + dependencies: + compare-func "^2.0.0" + q "^1.5.1" + +conventional-changelog-conventionalcommits@^4.3.1: + version "4.6.1" + resolved "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.1.tgz#f4c0921937050674e578dc7875f908351ccf4014" + integrity sha512-lzWJpPZhbM1R0PIzkwzGBCnAkH5RKJzJfFQZcl/D+2lsJxAwGnDKBqn/F4C1RD31GJNn8NuKWQzAZDAVXPp2Mw== + dependencies: + compare-func "^2.0.0" + lodash "^4.17.15" + q "^1.5.1" + +conventional-commits-parser@^3.2.2: + version "3.2.3" + resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.3.tgz#fc43704698239451e3ef35fd1d8ed644f46bd86e" + integrity sha512-YyRDR7On9H07ICFpRm/igcdjIqebXbvf4Cff+Pf0BrBys1i1EOzx9iFXNlAbdrLAR8jf7bkUYkDAr8pEy0q4Pw== + dependencies: + JSONStream "^1.0.4" + is-text-path "^1.0.1" + lodash "^4.17.15" + meow "^8.0.0" + split2 "^3.0.0" + through2 "^4.0.0" + +convert-source-map@^1.7.0: + version "1.8.0" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== + dependencies: + safe-buffer "~5.1.1" + +cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.2.1" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +cross-spawn@^5.0.1, cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +csv-generate@^3.4.3: + version "3.4.3" + resolved "https://registry.npmjs.org/csv-generate/-/csv-generate-3.4.3.tgz#bc42d943b45aea52afa896874291da4b9108ffff" + integrity sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw== + +csv-parse@^4.16.3: + version "4.16.3" + resolved "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz#7ca624d517212ebc520a36873c3478fa66efbaf7" + integrity sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg== + +csv-stringify@^5.6.5: + version "5.6.5" + resolved "https://registry.npmjs.org/csv-stringify/-/csv-stringify-5.6.5.tgz#c6d74badda4b49a79bf4e72f91cce1e33b94de00" + integrity sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A== + +csv@^5.3.1: + version "5.5.3" + resolved "https://registry.npmjs.org/csv/-/csv-5.5.3.tgz#cd26c1e45eae00ce6a9b7b27dcb94955ec95207d" + integrity sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g== + dependencies: + csv-generate "^3.4.3" + csv-parse "^4.16.3" + csv-stringify "^5.6.5" + stream-transform "^2.1.3" + +dargs@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" + integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== + +dataloader@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8" + integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw== + +debug@4.3.2, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: + version "4.3.2" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + +debug@^2.6.9: + version "2.6.9" + resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +decamelize-keys@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" + integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= + dependencies: + decamelize "^1.1.0" + map-obj "^1.0.0" + +decamelize@^1.1.0, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +default-require-extensions@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz#e03f93aac9b2b6443fc52e5e4a37b3ad9ad8df96" + integrity sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg== + dependencies: + strip-bom "^4.0.0" + +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= + dependencies: + clone "^1.0.2" + +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +detect-indent@^6.0.0: + version "6.1.0" + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" + integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +dot-prop@^5.1.0: + version "5.3.0" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" + integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== + dependencies: + is-obj "^2.0.0" + +dotenv@^8.1.0: + version "8.6.0" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" + integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== + +electron-to-chromium@^1.3.886: + version "1.3.886" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.886.tgz#ac039c4001b665b1dd0f0ed9c2e4da90ff3c9267" + integrity sha512-+vYdeBosI63VkCtNWnEVFjgNd/IZwvnsWkKyPtWAvrhA+XfByKoBJcbsMgudVU/bUcGAF9Xp3aXn96voWlc3oQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +enquirer@^2.3.0, enquirer@^2.3.5, enquirer@^2.3.6: + version "2.3.6" + resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.19.0, es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.1" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" + is-string "^1.0.7" + is-weakref "^1.0.1" + object-inspect "^1.11.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es6-error@^4.0.1: + version "4.1.1" + resolved "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" + integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-config-prettier@8.3.0: + version "8.3.0" + resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" + integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== + +eslint-import-resolver-alias@1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz#297062890e31e4d6651eb5eba9534e1f6e68fc97" + integrity sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w== + +eslint-import-resolver-node@^0.3.6: + version "0.3.6" + resolved "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" + integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-import-resolver-typescript@2.5.0: + version "2.5.0" + resolved "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.5.0.tgz#07661966b272d14ba97f597b51e1a588f9722f0a" + integrity sha512-qZ6e5CFr+I7K4VVhQu3M/9xGv9/YmwsEXrsm3nimw8vWaVHRDrQRp26BgCypTxBp3vUp4o5aVEJRiy0F2DFddQ== + dependencies: + debug "^4.3.1" + glob "^7.1.7" + is-glob "^4.0.1" + resolve "^1.20.0" + tsconfig-paths "^3.9.0" + +eslint-module-utils@^2.7.0: + version "2.7.1" + resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" + integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== + dependencies: + debug "^3.2.7" + find-up "^2.1.0" + pkg-dir "^2.0.0" + +"eslint-plugin-es-roikoren@file:.": + version "0.0.0" + dependencies: + "@typescript-eslint/experimental-utils" "5.3.0" + regexpp "3.2.0" + +eslint-plugin-eslint-plugin@4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-4.0.2.tgz#80f63080c0a5b444a949ef1ed5f79a4dc2ef4ef4" + integrity sha512-EUNNLrWvwQ7QU6GGYWGMw7IHGSIGDn5GCbnQlzFHH5ypgL1gR9Fk0dUnOpzyPaI+OLc6rAs7Askv+IPFUKJdOQ== + dependencies: + eslint-utils "^3.0.0" + estraverse "^5.2.0" + +eslint-plugin-import@2.25.2: + version "2.25.2" + resolved "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.2.tgz#b3b9160efddb702fc1636659e71ba1d10adbe9e9" + integrity sha512-qCwQr9TYfoBHOFcVGKY9C9unq05uOxxdklmBXLVvcwo68y5Hta6/GzCZEMx2zQiu0woKNEER0LE7ZgaOfBU14g== + dependencies: + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.7.0" + has "^1.0.3" + is-core-module "^2.7.0" + is-glob "^4.0.3" + minimatch "^3.0.4" + object.values "^1.1.5" + resolve "^1.20.0" + tsconfig-paths "^3.11.0" + +eslint-plugin-prettier@4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" + integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-plugin-unicorn@38.0.1: + version "38.0.1" + resolved "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-38.0.1.tgz#f95a7fa6e8c92617cdcb4b1ddbc15d877477e73d" + integrity sha512-eu4HCg7Bv43nk/hYZoWpLzRo668Nb7swQySn94aohn0heh9KLJ1GOFgVxJndLS8BploMGaClxgsyTNGJrP69yw== + dependencies: + "@babel/helper-validator-identifier" "^7.14.9" + ci-info "^3.2.0" + clean-regexp "^1.0.0" + eslint-template-visitor "^2.3.2" + eslint-utils "^3.0.0" + esquery "^1.4.0" + indent-string "4" + is-builtin-module "^3.1.0" + lodash "^4.17.21" + pluralize "^8.0.0" + read-pkg-up "^7.0.1" + regexp-tree "^0.1.23" + safe-regex "^2.1.1" + semver "^7.3.5" + strip-indent "^3.0.0" + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-scope@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz#9cf45b13c5ac8f3d4c50f46a5121f61b3e318978" + integrity sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-template-visitor@^2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/eslint-template-visitor/-/eslint-template-visitor-2.3.2.tgz#b52f96ff311e773a345d79053ccc78275bbc463d" + integrity sha512-3ydhqFpuV7x1M9EK52BPNj6V0Kwu0KKkcIAfpUhwHbR8ocRln/oUHgfxQupY8O1h4Qv/POHDumb/BwwNfxbtnA== + dependencies: + "@babel/core" "^7.12.16" + "@babel/eslint-parser" "^7.12.16" + eslint-visitor-keys "^2.0.0" + esquery "^1.3.1" + multimap "^1.1.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz#e32e99c6cdc2eb063f204eda5db67bfe58bb4186" + integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q== + +eslint@8.2.0: + version "8.2.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-8.2.0.tgz#44d3fb506d0f866a506d97a0fc0e90ee6d06a815" + integrity sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw== + dependencies: + "@eslint/eslintrc" "^1.0.4" + "@humanwhocodes/config-array" "^0.6.0" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^6.0.0" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.0.0" + espree "^9.0.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^6.0.1" + globals "^13.6.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.2.0" + semver "^7.2.1" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/espree/-/espree-9.0.0.tgz#e90a2965698228502e771c7a58489b1a9d107090" + integrity sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ== + dependencies: + acorn "^8.5.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^3.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.3.1, esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^5.0.0, execa@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +extendable-error@^0.1.5: + version "0.1.7" + resolved "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz#60b9adf206264ac920058a7395685ae4670c2b96" + integrity sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg== + +external-editor@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-glob@^3.1.1: + version "3.2.7" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-cache-dir@^3.2.0: + version "3.3.2" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + +find-up@5.0.0, find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-yarn-workspace-root2@1.2.16: + version "1.2.16" + resolved "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz#60287009dd2f324f59646bdb4b7610a6b301c2a9" + integrity sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA== + dependencies: + micromatch "^4.0.2" + pkg-dir "^4.2.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +flatted@^3.1.0: + version "3.2.2" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" + integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== + +foreground-child@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" + integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^3.0.2" + +fromentries@^1.2.0: + version "1.3.2" + resolved "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" + integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== + +fs-extra@^10.0.0: + version "10.0.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" + integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.1, get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.2" + resolved "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" + integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +git-raw-commits@^2.0.0: + version "2.0.10" + resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz#e2255ed9563b1c9c3ea6bd05806410290297bbc1" + integrity sha512-sHhX5lsbG9SOO6yXdlwgEMQ/ljIn7qMpAbJZCGfXX2fq5T8M5SrDnpYk9/4HswTildcIqatsWa91vty6VhWSaQ== + dependencies: + dargs "^7.0.0" + lodash "^4.17.15" + meow "^8.0.0" + split2 "^3.0.0" + through2 "^4.0.0" + +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@7.1.7, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7: + version "7.1.7" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-dirs@^0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= + dependencies: + ini "^1.3.4" + +globals@13.12.0, globals@^13.6.0, globals@^13.9.0: + version "13.12.0" + resolved "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e" + integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg== + dependencies: + type-fest "^0.20.2" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globby@^11.0.0, globby@^11.0.4: + version "11.0.4" + resolved "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + 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" + +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.8" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +hard-rejection@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" + integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== + +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hasha@^5.0.0: + version "5.2.2" + resolved "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz#a48477989b3b327aea3c04f53096d816d97522a1" + integrity sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ== + dependencies: + is-stream "^2.0.0" + type-fest "^0.8.0" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + +hosted-git-info@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" + integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== + dependencies: + lru-cache "^6.0.0" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +human-id@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz#e654d4b2b0d8b07e45da9f6020d8af17ec0a5df3" + integrity sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw== + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +husky@7.0.4: + version "7.0.4" + resolved "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" + integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +ignore@^5.1.4, ignore@^5.1.8: + version "5.1.8" + resolved "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +indent-string@4, indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3: + version "2.0.4" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^1.3.4: + version "1.3.8" + resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-builtin-module@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz#6fdb24313b1c03b75f8b9711c0feb8c30b903b00" + integrity sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg== + dependencies: + builtin-modules "^3.0.0" + +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.7.0: + version "2.8.0" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + +is-number-object@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + dependencies: + has-tostringtag "^1.0.0" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-subdir@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz#b791cd28fab5202e91a08280d51d9d7254fd20d4" + integrity sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw== + dependencies: + better-path-resolve "1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-text-path@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= + dependencies: + text-extensions "^1.0.0" + +is-typedarray@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-weakref@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" + integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== + dependencies: + call-bind "^1.0.0" + +is-windows@^1.0.0, is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.0.0-alpha.1: + version "3.2.0" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + +istanbul-lib-hook@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz#8f84c9434888cc6b1d0a9d7092a76d239ebf0cc6" + integrity sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ== + dependencies: + append-transform "^2.0.0" + +istanbul-lib-instrument@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" + integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== + dependencies: + "@babel/core" "^7.7.5" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" + +istanbul-lib-processinfo@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz#e1426514662244b2f25df728e8fd1ba35fe53b9c" + integrity sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw== + dependencies: + archy "^1.0.0" + cross-spawn "^7.0.0" + istanbul-lib-coverage "^3.0.0-alpha.1" + make-dir "^3.0.0" + p-map "^3.0.0" + rimraf "^3.0.0" + uuid "^3.3.3" + +istanbul-lib-report@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" + integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^3.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.0.2: + version "3.0.5" + resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz#a2580107e71279ea6d661ddede929ffc6d693384" + integrity sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@4.1.0, js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.6.1: + version "3.14.1" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +json5@^2.1.2: + version "2.2.0" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + +kind-of@^6.0.3: + version "6.0.3" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +lint-staged@11.2.6: + version "11.2.6" + resolved "https://registry.npmjs.org/lint-staged/-/lint-staged-11.2.6.tgz#f477b1af0294db054e5937f171679df63baa4c43" + integrity sha512-Vti55pUnpvPE0J9936lKl0ngVeTdSZpEdTNhASbkaWX7J5R9OEifo1INBGQuGW4zmy6OG+TcWPJ3m5yuy5Q8Tg== + dependencies: + cli-truncate "2.1.0" + colorette "^1.4.0" + commander "^8.2.0" + cosmiconfig "^7.0.1" + debug "^4.3.2" + enquirer "^2.3.6" + execa "^5.1.1" + listr2 "^3.12.2" + micromatch "^4.0.4" + normalize-path "^3.0.0" + please-upgrade-node "^3.2.0" + string-argv "0.3.1" + stringify-object "3.3.0" + supports-color "8.1.1" + +listr2@^3.12.2: + version "3.13.1" + resolved "https://registry.npmjs.org/listr2/-/listr2-3.13.1.tgz#816e8c1728d50f223795f530d72d248c7fa14602" + integrity sha512-pk4YBDA2cxtpM8iLHbz6oEsfZieJKHf6Pt19NlKaHZZVpqHyVs/Wqr7RfBBCeAFCJchGO7WQHVkUPZTvJMHk8w== + dependencies: + cli-truncate "^2.1.0" + colorette "^2.0.16" + log-update "^4.0.0" + p-map "^4.0.0" + rxjs "^6.6.7" + through "^2.3.8" + wrap-ansi "^7.0.0" + +load-yaml-file@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz#af854edaf2bea89346c07549122753c07372f64d" + integrity sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw== + dependencies: + graceful-fs "^4.1.5" + js-yaml "^3.13.0" + pify "^4.0.1" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= + +lodash.get@^4: + version "4.4.2" + resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash.startcase@^4.4.0: + version "4.4.0" + resolved "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" + integrity sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg= + +lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +log-update@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" + integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== + dependencies: + ansi-escapes "^4.3.0" + cli-cursor "^3.1.0" + slice-ansi "^4.0.0" + wrap-ansi "^6.2.0" + +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +make-error@^1, make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +map-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + +map-obj@^4.0.0: + version "4.3.0" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" + integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== + +meow@^6.0.0: + version "6.1.1" + resolved "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz#1ad64c4b76b2a24dfb2f635fddcadf320d251467" + integrity sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg== + dependencies: + "@types/minimist" "^1.2.0" + camelcase-keys "^6.2.2" + decamelize-keys "^1.1.0" + hard-rejection "^2.1.0" + minimist-options "^4.0.2" + normalize-package-data "^2.5.0" + read-pkg-up "^7.0.1" + redent "^3.0.0" + trim-newlines "^3.0.0" + type-fest "^0.13.1" + yargs-parser "^18.1.3" + +meow@^8.0.0: + version "8.1.2" + resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" + integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== + dependencies: + "@types/minimist" "^1.2.0" + camelcase-keys "^6.2.2" + decamelize-keys "^1.1.0" + hard-rejection "^2.1.0" + minimist-options "4.1.0" + normalize-package-data "^3.0.0" + read-pkg-up "^7.0.1" + redent "^3.0.0" + trim-newlines "^3.0.0" + type-fest "^0.18.0" + yargs-parser "^20.2.3" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.2, micromatch@^4.0.4: + version "4.0.4" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +min-indent@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" + integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist-options@4.1.0, minimist-options@^4.0.2: + version "4.1.0" + resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" + integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== + dependencies: + arrify "^1.0.1" + is-plain-obj "^1.1.0" + kind-of "^6.0.3" + +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mixme@^0.5.1: + version "0.5.4" + resolved "https://registry.npmjs.org/mixme/-/mixme-0.5.4.tgz#8cb3bd0cd32a513c161bf1ca99d143f0bcf2eff3" + integrity sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw== + +mocha@9.1.3: + version "9.1.3" + resolved "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" + integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.2" + debug "4.3.2" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.7" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "3.0.4" + ms "2.1.3" + nanoid "3.1.25" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.1.5" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +multimap@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/multimap/-/multimap-1.1.0.tgz#5263febc085a1791c33b59bb3afc6a76a2a10ca8" + integrity sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw== + +nanoid@3.1.25: + version "3.1.25" + resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +node-fetch@^2.5.0: + version "2.6.6" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89" + integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA== + dependencies: + whatwg-url "^5.0.0" + +node-preload@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301" + integrity sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ== + dependencies: + process-on-spawn "^1.0.0" + +node-releases@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== + +normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-package-data@^3.0.0: + version "3.0.3" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" + integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== + dependencies: + hosted-git-info "^4.0.1" + is-core-module "^2.5.0" + semver "^7.3.4" + validate-npm-package-license "^3.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +nyc@15.1.0: + version "15.1.0" + resolved "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz#1335dae12ddc87b6e249d5a1994ca4bdaea75f02" + integrity sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A== + dependencies: + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + caching-transform "^4.0.0" + convert-source-map "^1.7.0" + decamelize "^1.2.0" + find-cache-dir "^3.2.0" + find-up "^4.1.0" + foreground-child "^2.0.0" + get-package-type "^0.1.0" + glob "^7.1.6" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-hook "^3.0.0" + istanbul-lib-instrument "^4.0.0" + istanbul-lib-processinfo "^2.0.2" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + make-dir "^3.0.0" + node-preload "^0.2.1" + p-map "^3.0.0" + process-on-spawn "^1.0.0" + resolve-from "^5.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + spawn-wrap "^2.0.0" + test-exclude "^6.0.0" + yargs "^15.0.2" + +object-inspect@^1.11.0, object-inspect@^1.9.0: + version "1.11.0" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" + integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^5.1.0, onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + 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" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +outdent@^0.5.0: + version "0.5.0" + resolved "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz#9e10982fdc41492bb473ad13840d22f9655be2ff" + integrity sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q== + +p-filter@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz#1b1472562ae7a0f742f0f3d3d3718ea66ff9c09c" + integrity sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw== + dependencies: + p-map "^2.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== + +p-map@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" + integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== + dependencies: + aggregate-error "^3.0.0" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +package-hash@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz#3537f654665ec3cc38827387fc904c163c54f506" + integrity sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ== + dependencies: + graceful-fs "^4.1.15" + hasha "^5.0.0" + lodash.flattendeep "^4.4.0" + release-zalgo "^1.0.0" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^5.0.0: + version "5.2.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: + version "2.3.0" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + +pkg-dir@^4.1.0, pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +please-upgrade-node@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" + integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== + dependencies: + semver-compare "^1.0.0" + +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + +preferred-pm@^3.0.0: + version "3.0.3" + resolved "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz#1b6338000371e3edbce52ef2e4f65eb2e73586d6" + integrity sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ== + dependencies: + find-up "^5.0.0" + find-yarn-workspace-root2 "1.2.16" + path-exists "^4.0.0" + which-pm "2.0.0" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@2.4.1, prettier@^1.19.1: + version "2.4.1" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== + +process-on-spawn@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz#95b05a23073d30a17acfdc92a440efd2baefdc93" + integrity sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg== + dependencies: + fromentries "^1.2.0" + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +q@^1.5.1: + version "1.5.1" + resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +quick-lru@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" + integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + +read-yaml-file@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz#9362bbcbdc77007cc8ea4519fe1c0b821a7ce0d8" + integrity sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA== + dependencies: + graceful-fs "^4.1.5" + js-yaml "^3.6.1" + pify "^4.0.1" + strip-bom "^3.0.0" + +readable-stream@3, readable-stream@^3.0.0: + version "3.6.0" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +redent@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" + integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== + dependencies: + indent-string "^4.0.0" + strip-indent "^3.0.0" + +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +regexp-tree@^0.1.23, regexp-tree@~0.1.1: + version "0.1.24" + resolved "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.24.tgz#3d6fa238450a4d66e5bc9c4c14bb720e2196829d" + integrity sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw== + +regexpp@3.2.0, regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +release-zalgo@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" + integrity sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA= + dependencies: + es6-error "^4.0.1" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-from@5.0.0, resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-global@1.0.0, resolve-global@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz#a2a79df4af2ca3f49bf77ef9ddacd322dad19255" + integrity sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw== + dependencies: + global-dirs "^0.1.1" + +resolve@^1.10.0, resolve@^1.20.0: + version "1.20.0" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.0, rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +rxjs@^6.6.7: + version "6.6.7" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== + dependencies: + tslib "^1.9.0" + +safe-buffer@^5.1.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz#f7128f00d056e2fe5c11e81a1324dd974aadced2" + integrity sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A== + dependencies: + regexp-tree "~0.1.1" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + +"semver@2 || 3 || 4 || 5", semver@^5.4.1: + version "5.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@7.3.5, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: + version "7.3.5" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + +semver@^6.0.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: + version "3.0.5" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" + integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" + integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +smartwrap@^1.2.3: + version "1.2.5" + resolved "https://registry.npmjs.org/smartwrap/-/smartwrap-1.2.5.tgz#45ee3e09ac234e5f7f17c16e916f511834f3cd23" + integrity sha512-bzWRwHwu0RnWjwU7dFy7tF68pDAx/zMSu3g7xr9Nx5J0iSImYInglwEVExyHLxXljy6PWMjkSAbwF7t2mPnRmg== + dependencies: + breakword "^1.0.5" + grapheme-splitter "^1.0.4" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + yargs "^15.1.0" + +source-map-support@^0.5.17: + version "0.5.20" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.5.0: + version "0.5.7" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spawn-wrap@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" + integrity sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg== + dependencies: + foreground-child "^2.0.0" + is-windows "^1.0.2" + make-dir "^3.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + which "^2.0.1" + +spawndamnit@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz#9f762ac5c3476abb994b42ad592b5ad22bb4b0ad" + integrity sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA== + dependencies: + cross-spawn "^5.1.0" + signal-exit "^3.0.2" + +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.10" + resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" + integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== + +split2@^3.0.0: + version "3.2.2" + resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" + integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== + dependencies: + readable-stream "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +stream-transform@^2.1.3: + version "2.1.3" + resolved "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz#a1c3ecd72ddbf500aa8d342b0b9df38f5aa598e3" + integrity sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ== + dependencies: + mixme "^0.5.1" + +string-argv@0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== + +string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +stringify-object@3.3.0: + version "3.3.0" + resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-indent@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" + integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== + dependencies: + min-indent "^1.0.0" + +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +term-size@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= + dependencies: + execa "^0.7.0" + +term-size@^2.1.0: + version "2.2.1" + resolved "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" + integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +text-extensions@^1.0.0: + version "1.9.0" + resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" + integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through2@^4.0.0: + version "4.0.2" + resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" + integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== + dependencies: + readable-stream "3" + +"through@>=2.2.7 <3", through@^2.3.8: + version "2.3.8" + resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + +trim-newlines@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" + integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== + +ts-node@^9: + version "9.1.1" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" + integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== + dependencies: + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + +tsconfig-paths@^3.11.0, tsconfig-paths@^3.9.0: + version "3.11.0" + resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" + integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tslib@^1.8.1, tslib@^1.9.0: + version "1.14.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2: + version "2.3.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +tty-table@^2.8.10: + version "2.8.13" + resolved "https://registry.npmjs.org/tty-table/-/tty-table-2.8.13.tgz#d484a416381973eaebbdf19c79136b390e5c6d70" + integrity sha512-eVV/+kB6fIIdx+iUImhXrO22gl7f6VmmYh0Zbu6C196fe1elcHXd7U6LcLXu0YoVPc2kNesWiukYcdK8ZmJ6aQ== + dependencies: + chalk "^3.0.0" + csv "^5.3.1" + smartwrap "^1.2.3" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + yargs "^15.1.0" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@2.5.3: + version "2.5.3" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-2.5.3.tgz#2538287381b24d0c1d4911279934f28aaa10d620" + integrity sha512-7VNmE7FlsrdcWjKbtuRuynZz96Gmf35p5DvoR2tbceNP0vd58ISx87PvUUInlhtRC49vSX6qlxEKc7AoiHRirg== + +type-fest@^0.13.1: + version "0.13.1" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" + integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== + +type-fest@^0.18.0: + version "0.18.1" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" + integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + +type-fest@^0.8.0, type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +typescript@4.4.4, typescript@^4.4.3: + version "4.4.4" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" + integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== + +unbox-primitive@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +uuid@^3.3.3: + version "3.4.0" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +v8-compile-cache@^2.0.3: + version "2.3.0" + resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= + dependencies: + defaults "^1.0.3" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which-pm@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz#8245609ecfe64bf751d0eef2f376d83bf1ddb7ae" + integrity sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w== + dependencies: + load-yaml-file "^0.2.0" + path-exists "^4.0.0" + +which@2.0.2, which@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +widest-line@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" + integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== + dependencies: + string-width "^2.1.1" + +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +workerpool@6.1.5: + version "6.1.5" + resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" + integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + +yargs-parser@20.2.4, yargs-parser@^20.2.2, yargs-parser@^20.2.3: + version "20.2.4" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^18.1.2, yargs-parser@^18.1.3: + version "18.1.3" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yargs@^15.0.2, yargs@^15.1.0: + version "15.4.1" + resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + +yargs@^17.0.0: + version "17.2.1" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" + integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yarn-deduplicate@3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/yarn-deduplicate/-/yarn-deduplicate-3.1.0.tgz#3018d93e95f855f236a215b591fe8bc4bcabba3e" + integrity sha512-q2VZ6ThNzQpGfNpkPrkmV7x5HT9MOhCUsTxVTzyyZB0eSXz1NTodHn+r29DlLb+peKk8iXxzdUVhQG9pI7moFw== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + commander "^6.1.0" + semver "^7.3.2" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==