Skip to content

Commit

Permalink
Merge branch 'main' into prefer-nullish-coalescing
Browse files Browse the repository at this point in the history
  • Loading branch information
cparros committed Dec 5, 2022
2 parents 3199c29 + 768e2a1 commit 794144e
Show file tree
Hide file tree
Showing 476 changed files with 20,058 additions and 3,925 deletions.
5 changes: 3 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@
"ruleset",
"rulesets",
"serializers",
"Sourcegraph",
"superset",
"thenables",
"transpiled",
"transpiles",
"transpiling",
"triaging",
"tsconfigs",
"tseslint",
"tsutils",
"tsvfs",
"typedef",
Expand All @@ -116,8 +118,7 @@
"unoptimized",
"unprefixed",
"upsert",
"Zacher",
"tseslint"
"Zacher"
],
"overrides": [
{
Expand Down
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,23 @@ module.exports = {
'./packages/eslint-plugin/src/rules/**/*.ts',
],
rules: {
'eslint-plugin/require-meta-docs-description': [
'error',
{ pattern: '^(Enforce|Require|Disallow) .+[^. ]$' },
],

// specifically for rules - default exports makes the tooling easier
'import/no-default-export': 'off',

'no-restricted-syntax': [
'error',
{
selector:
'ExportDefaultDeclaration Property[key.name="create"] MemberExpression[object.name="context"][property.name="options"]',
message:
"Retrieve options from create's second parameter so that defaultOptions are applied.",
},
],
},
},
// plugin rule tests
Expand Down
24 changes: 24 additions & 0 deletions .github/DISCUSSION_TEMPLATE/rfcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
body:
- attributes:
label: RFC
value: |
Suggested changes...
id: rfc
type: textarea
- attributes:
label: Additional Info
value: |
Any additional info...
id: additional
type: textarea
- attributes:
label: Before you submit your RFC, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
options:
- label: I have [searched for related discussions](https://github.com/typescript-eslint/typescript-eslint/discussions) and [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues) and found none that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
id: required-checks
type: checkboxes
labels: ['rfc']
title: Your Title Here
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/01-bug-report-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ body:
required: true
- label: I have updated to the latest version of the packages.
required: true
- label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Abug+label%3A%22package%3A+eslint-plugin%22) and found none that matched my issue.
- label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3A%22package%3A+eslint-plugin%22) and found none that matched my issue.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: input
id: playground-link
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/02-enhancement-rule-option.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ body:
required: true
- label: I have searched the [current rule list](https://typescript-eslint.io/rules/#supported-rules) and found no rules that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: checkboxes
id: rule-fits-the-brief
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/03-enhancement-new-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ body:
required: true
- label: I have searched the [current rule list](https://typescript-eslint.io/rules/#supported-rules) and found no rules that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: checkboxes
id: rule-fits-the-brief
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body:
required: true
- label: I have searched the [current extension rule list](https://typescript-eslint.io/rules/#extension-rules) and found no rules that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: checkboxes
id: rule-fits-the-brief
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/05-documentation-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
options:
- label: I have looked for existing [open or closed documentation requests](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Adocumentation) that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/06-bug-report-other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
required: true
- label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Abug) and found none that matched my issue.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: markdown
id: complexity-note
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/07-enhancement-other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body:
required: true
- label: I have searched the [current rule list](https://typescript-eslint.io/rules/#supported-rules) and found no rules that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: dropdown
id: package
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/08-bug-report-complex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ body:
required: true
- label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Abug) and found none that matched my issue.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: textarea
id: description
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/09-config-change.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
options:
- label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3A%22preset+config+change%22+) and found none that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
- type: textarea
id: description
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ blank_issues_enabled: false
contact_links:
- name: FAQ
about: Please check out our FAQ before filing new issues
url: https://typescript-eslint.io/docs/linting/troubleshooting
url: https://typescript-eslint.io/linting/troubleshooting
- name: Getting Started Guide
about: If you're looking for help setting up check out our getting started guide
url: https://typescript-eslint.io/docs/
url: https://typescript-eslint.io
20 changes: 17 additions & 3 deletions .github/SPONSORSHIPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ Sponsoring TypeScript ESLint helps keep our development process running reliably
- Fix bugs and add new features to existing rules
- Write more advanced rules to solve more areas of application correctness

### Sponsorship Benefits

In addition to benefitting the TypeScript ecosystem, sponsoring us on Open Collective helps promote your company and development brand.
Our top sponsors may have their link, logo, and/or name featured on the homepage of [typescript-eslint.io](https://typescript-eslint.io).

At present, sponsors must have given at least $100 to be featured on the homepage.
Placement tiers are based on total donations:

- Platinum sponsors: Top 6 donators
- Gold supporters: The next 10 donators
- Silver supporters: The next 18 donators

You can always view all financial contributors on [opencollective.com/typescript-eslint](https://opencollective.com/typescript-eslint).

> Got an idea for how to make sponsorship work for you?
> Let us know at `typescripteslint@gmail.com`!
## Sponsorship Limitations

### Project Direction
Expand All @@ -25,7 +42,6 @@ If you have a need to push forward an area of work in TypeScript ESLint more urg

### Website Placement

Our top sponsors may have their link, logo, and/or name featured on the homepage of https://typescript-eslint.io.
We are inclusive by default and allow all organizations that newly meet a monetary threshold to be added.
However, at our discretion, we may remove organizations we feel we cannot promote in good conscience.
Organizations would most commonly be removed if their core charter and/or repeated organization-wide intentional activities:
Expand All @@ -35,5 +51,3 @@ Organizations would most commonly be removed if their core charter and/or repeat
- Finance and/or promote other organizations that match these issues

If you disagree with a choice made by the maintenance team, or would like a refund for your sponsorship, please let us know by emailing `typescripteslint@gmail.com`.

> You can always view all financial contributors on [opencollective.com/typescript-eslint](https://opencollective.com/typescript-eslint).
4 changes: 2 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
'globby',
// this dep now uses package.json exports - we will be removing it next major
'eslint-scope',
// this dep is now ESM only
'execa',
// the nx packages get updated using the nx migrate CLI
'@nrwl/cli',
'@nrwl/devkit',
'@nrwl/jest',
'@nrwl/nx-cloud',
'@nrwl/tao',
'@nrwl/workspace',
'nx',
],
ignorePaths: [
// integration test package.json's should never be updated as they're purposely fixed tests
Expand Down
11 changes: 10 additions & 1 deletion .github/replies.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
replies:
- body: |
👋 Hey @{{ author }}! Just checking in, is this still something you have time for? No worries if not - I just don't want to leave it hanging.
name: Checking In
- body: |
Thanks for posting! This is a duplicate of #<insert issue>. Before filing an issue, please [use our issue search](https://github.com/typescript-eslint/typescript-eslint/issues) to check for open and closed issues that already address what you're looking for.
name: Clearly Duplicate Issue
Expand Down Expand Up @@ -52,6 +55,12 @@ replies:
If this issue is important to you — consider being that champion.
If not — please use the subscribe function and wait patiently for someone else to implement this.
name: Progress - Nice
- body: |
Closing this issue as it's been stale for ~6 weeks without activity. Feel free to reopen @{{ author }} if you have time - but no worries if not! If anybody wants to drive it forward, please do either post here or in a new issue with the info we asked about. Thanks! 😊
name: Pruning Stale Issue
- body: |
Closing this PR as it's been stale for ~6 weeks without activity. Feel free to reopen @{{ author }} if you have time - but no worries if not! If anybody wants to drive it forward, please do post your own PR - and if you use this as a start, consider adding `Co-authored-by: @{{ author }}` at the end of your PR description. Thanks! 😊
name: Pruning Stale PR
- body: |
As per [our contributing guidelines](https://github.com/typescript-eslint/typescript-eslint/blob/master/CONTRIBUTING.md#addressing-feedback-and-beyond) this PR is in the queue of PRs to reviewed, and will be reviewed when we are able.
\
Expand All @@ -64,5 +73,5 @@ replies:
The configurability also leads to huge fanout [making tests huge, and awful to maintain](https://github.com/typescript-eslint/typescript-eslint/blob/b814e635c1f34139c89e0176727480935dd45cac/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts).
\
It's for these reasons that [eslint has frozen all stylistic lint rule options, and will not accept any new ones](https://eslint.org/blog/2020/05/changes-to-rules-policies).
See also our [What About Formatting?](https://typescript-eslint.io/docs/linting/troubleshooting/formatting) docs.
See also our [What About Formatting?](https://typescript-eslint.io/linting/troubleshooting/formatting) docs.
name: Use Prettier
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ jobs:
# would override the config
- name: Run unit tests with coverage for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION == matrix.node-version
run: npx nx test @typescript-eslint/${{ matrix.package }}
run: npx nx test ${{ matrix.package }}
env:
CI: true
- name: Run unit tests for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION != matrix.node-version
run: npx nx test @typescript-eslint/${{ matrix.package }} --coverage=false
run: npx nx test ${{ matrix.package }} --coverage=false
env:
CI: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- uses: dessant/lock-threads@v3
with:
github-token: ${{ github.token }}
issue-inactive-days: '30'
issue-inactive-days: '7'
issue-lock-reason: 'resolved'
issue-comment: ''
pr-inactive-days: '30'
pr-inactive-days: '7'
pr-lock-reason: 'resolved'
pr-comment: ''
85 changes: 85 additions & 0 deletions .github/workflows/nx-migrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# This workflow is used to augment the capabilities of the renovate GitHub app by running a full
# `nx migrate` when renovate opens a PR to change the version of @nrwl/workspace.
#
# You will therefore also notice that in the renovate configuration, we ignore any packages which
# Nx will manage for us as part of `nx migrate` such as the remaining @nrwl/* packages and jest.

name: Nx Migrate

on:
pull_request:
branches: [main]
paths:
- 'package.json'

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

jobs:
maybe_nx_migrate:
# Only run if it was the renovate bot that triggered the workflow (otherwise we'll create a loop)
if: contains('["renovate[bot]"]', github.actor) == true
name: Run nx migrate if required
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# To allow us to perform the git diff we need the git history
fetch-depth: 0
# To ensure we can push from a different user (and therefore cause actions to rerun)
persist-credentials: false

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3

- name: Check if @nrwl/workspace was changed as part of the latest commit on the PR
id: nrwl-workspace-package-check
run: |
git diff HEAD~1 -G"@nrwl/workspace" --exit-code package.json && echo "@nrwl/workspace unchanged" || echo "::set-output name=was-changed::true"
- name: Run nx migrate if @nrwl/workspace changed and commit the results
if: ${{ steps.nrwl-workspace-package-check.outputs.was-changed == 'true' }}
env:
# We cannot use secrets.GITHUB_TOKEN for this because it is not permitted to kick off subsequent actions worfklow runs, so we use a PAT instead
GITHUB_TOKEN: ${{ secrets.JAMES_HENRY_GITHUB_TOKEN }}
# We don't want to run any of our postinstall logic when Nx is invoking install behind the scenes
SKIP_POSTINSTALL: 'true'
run: |
# Checkout the PR branch using the github CLI
gh pr checkout ${{ github.event.pull_request.number }}
# Get the version of Nx we are migrating to
NX_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@nrwl/workspace'])")
# Revert renovate's changes to package.json and yarn.lock so that it is a clean migrate from the status quo
git checkout HEAD~1 -- package.json yarn.lock
yarn --ignore-scripts
npx nx migrate @nrwl/workspace@$NX_VERSION
# Sometimes Nx can require config formatting changes after a migrate command
yarn --ignore-scripts
npx nx format
# migrations.json may or may not exist after running nx migrate
if [ -f migrations.json ]; then
# This will also invoke yarn automatically
npx nx migrate --run-migrations=migrations.json
# After we have run its migrations, we no longer need the migrations.json file
rm migrations.json
fi
# Ensure all the changed files are formatted appropriately
yarn format
# Commit all the changes to the PR (see note on not being able to use secrets.GITHUB_TOKEN for this)
git config --global user.email "james@henry.sc"
git config --global user.name "JamesHenry"
git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
git add --all
git commit -m "chore: run nx migrate for @nrwl/workspace v$NX_VERSION"
git push

0 comments on commit 794144e

Please sign in to comment.