Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Святослав Зайцев committed Nov 24, 2022
2 parents 10ff764 + 53671d3 commit 4576c26
Show file tree
Hide file tree
Showing 305 changed files with 16,242 additions and 5,387 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Expand Up @@ -106,6 +106,7 @@
"transpiled",
"transpiles",
"transpiling",
"triaging",
"tsconfigs",
"tsutils",
"tsvfs",
Expand Down
7 changes: 6 additions & 1 deletion .eslintrc.js
Expand Up @@ -257,6 +257,11 @@ 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',
},
Expand Down Expand Up @@ -308,7 +313,7 @@ module.exports = {
rules: {
// disallow ALL unused vars
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/sort-type-union-intersection-members': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
},
},
{
Expand Down
24 changes: 24 additions & 0 deletions .github/DISCUSSION_TEMPLATE/rfcs.yml
@@ -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/docs/linting/troubleshooting) and my problem is not listed.
required: true
id: required-checks
type: checkboxes
labels: ['rfc']
title: Your Title Here
20 changes: 17 additions & 3 deletions .github/SPONSORSHIPS.md
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
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
28 changes: 28 additions & 0 deletions .github/replies.yml
@@ -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 All @@ -17,6 +20,25 @@ replies:
\
If you need it sooner, please try the `canary` tag on NPM.
name: Fix Has Been Merged
- body: |
Thanks for the report @<reporter>!\
This might be a valid issue, but we can't tell because you haven't filled in enough information.\
Please fill in the rest of the issue template so we can take a look.\
Thanks!
name: Needs More Info
- body: |
Thanks for the report @<reporter>!\
I can't reproduce the issue using the repository you provided.\
Could you please comment with instructions on how to reproduce the issue?\
Thanks!
name: Needs Full Reproduction
- body: |
Thanks for the report @<reporter>!\
I can't reproduce the issue using the code you provided.\
Could you please create an isolated reproduction in our playground (https://typescript-eslint.io/play) and comment back when you've got one?\
We prefer an isolated reproduction so that we as volunteer maintainers can quickly reproduce the issue and more easily find the cause.\
Thanks!
name: Needs Playground Reproduction
- body: |
With any issue opened in this project — it either has visible progress in the form of an attached PR, or it has no progress.\
\
Expand All @@ -33,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 Down
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- v6
pull_request:
branches:
- '**'
Expand Down Expand Up @@ -249,3 +250,28 @@ jobs:
run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish_canary_version_v6:
name: Publish the next major version code as a canary version
runs-on: ubuntu-latest
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.ref == 'refs/heads/v${major}'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Build
uses: ./.github/actions/prepare-build

# Fetch all history for all tags and branches in this job because lerna needs it
- run: |
git fetch --prune --unshallow
- name: Publish all packages to npm
run: npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v${major}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/lock.yml
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
@@ -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
52 changes: 52 additions & 0 deletions .github/workflows/semantic-pr-titles.yml
@@ -0,0 +1,52 @@
name: Semantic PR Titles

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# keep this synchronized with the /CONTRIBUTING.md
types: |
docs
feat
fix
test
chore
# deps is used by renovate for its PRs
scopes: |
deps
ast-spec
eslint-plugin
eslint-plugin-internal
eslint-plugin-tslint
experimental-utils
parser
scope-manager
type-utils
types
typescript-estree
utils
visitor-keys
website
# we allow "cross package" PRs with no scope
requireScope: false
# ensure that the subject is lower-case first
# also allows "[rule-name] " prefix for eslint-plugin rule PRs
# https://regexr.com/733ed
subjectPattern: ^(\[[a-z\-]+\] )?[a-z].+[^\.]$
subjectPatternError: |
The "subject" must start with a lower-case letter and must not
end with a full-stop.
For PRs that add or change ESLint-plugin rules, you should begin
the title with "[rule-name] "
4 changes: 1 addition & 3 deletions .lintstagedrc
@@ -1,5 +1,3 @@
{
"*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}": [
"prettier --write"
]
"*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}": ["prettier --write"]
}

0 comments on commit 4576c26

Please sign in to comment.