Skip to content

Commit

Permalink
Merge branch 'main' into fix/issue-6439
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed Jul 17, 2023
2 parents 8e7992c + d67fd6d commit 081e79f
Show file tree
Hide file tree
Showing 3,614 changed files with 107,533 additions and 32,917 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
14 changes: 12 additions & 2 deletions .cspell.json
@@ -1,6 +1,14 @@
{
"version": "0.1",
"version": "0.2",
"language": "en",
"enableFiletypes": [
"markdown",
"mdx",
"typescript",
"typescriptreact",
"javascript",
"javascriptreact"
],
"ignorePaths": [
".cspell.json",
".github/workflows/**",
Expand Down Expand Up @@ -44,6 +52,7 @@
"ambiently",
"Armano",
"astexplorer",
"Astro",
"ASTs",
"autofix",
"autofixers",
Expand Down Expand Up @@ -108,15 +117,16 @@
"rulesets",
"serializers",
"Sourcegraph",
"stringification",
"superset",
"thenables",
"transpiled",
"transpiles",
"transpiling",
"triaging",
"trpc",
"tsconfigs",
"tseslint",
"tsutils",
"tsvfs",
"typedef",
"typedefs",
Expand Down
13 changes: 6 additions & 7 deletions .eslintignore
Expand Up @@ -7,12 +7,11 @@ __snapshots__
.docusaurus
build

packages/eslint-plugin-tslint/tests

packages/website/**/*.js
packages/website/**/*.d.ts
packages/website-eslint/**/*.js
packages/website-eslint/**/*.d.ts

# Files copied as part of the build
packages/types/src/generated/**/*.ts

# Playground types downloaded from the web
packages/website/src/vendor

# see the file header in eslint-base.test.js for more info
packages/rule-tester/tests/eslint-base
97 changes: 71 additions & 26 deletions .eslintrc.js
@@ -1,3 +1,5 @@
// @ts-check
/** @type {import('./packages/utils/src/ts-eslint/Linter').Linter.Config} */
module.exports = {
root: true,
plugins: [
Expand All @@ -12,21 +14,21 @@ module.exports = {
'unicorn',
],
env: {
es6: true,
es2020: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:eslint-plugin/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
// TODO: consider enabling strict-type-checked
],
parserOptions: {
sourceType: 'module',
project: [
'./tsconfig.eslint.json',
'./packages/*/tsconfig.json',
'./tests/integration/tsconfig.json',
/**
* We are currently in the process of transitioning to nx's out of the box structure and
* so need to manually specify converted packages' tsconfig.build.json and tsconfig.spec.json
Expand All @@ -51,6 +53,14 @@ module.exports = {
// make sure we're not leveraging any deprecated APIs
'deprecation/deprecation': 'error',

// TODO(#7138): Investigate enabling these soon ✨
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',

// TODO(#7130): Investigate changing these in or removing these from presets
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',

//
// our plugin :D
//
Expand All @@ -65,25 +75,18 @@ module.exports = {
minimumDescriptionLength: 5,
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', disallowTypeAnnotations: true },
],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': [
'@typescript-eslint/explicit-function-return-type': [
'error',
{ allow: ['arrowFunctions'] },
{ allowIIFEs: true },
],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
Expand All @@ -95,7 +98,7 @@ module.exports = {
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],

Expand Down Expand Up @@ -123,7 +126,7 @@ module.exports = {
'no-console': 'error',
'no-process-exit': 'error',
'no-fallthrough': [
'warn',
'error',
{ commentPattern: '.*intentional fallthrough.*' },
],

Expand Down Expand Up @@ -157,6 +160,7 @@ module.exports = {
'eslint-disable-line',
'eslint-disable-next-line',
'eslint-enable',
'global',
],
},
],
Expand Down Expand Up @@ -205,6 +209,18 @@ module.exports = {
'unicorn/no-typeof-undefined': 'error',
},
overrides: [
{
files: ['*.js'],
extends: ['plugin:@typescript-eslint/disable-type-checked'],
rules: {
// turn off other type-aware rules
'deprecation/deprecation': 'off',
'@typescript-eslint/internal/no-poorly-typed-ts-props': 'off',

// turn off rules that don't apply to JS code
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
// all test files
{
files: [
Expand All @@ -213,30 +229,33 @@ module.exports = {
'./packages/*/tests/**/spec.ts',
'./packages/*/tests/**/test.ts',
'./packages/parser/tests/**/*.ts',
'./tests/integration/**/*.test.ts',
'./tests/integration/integration-test-base.ts',
'./tests/integration/pack-packages.ts',
'./packages/integration-tests/tools/integration-test-base.ts',
'./packages/integration-tests/tools/pack-packages.ts',
],
env: {
'jest/globals': true,
},
rules: {
'@typescript-eslint/no-empty-function': [
'error',
{ allow: ['arrowFunctions'] },
],
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'eslint-plugin/consistent-output': 'off', // Might eventually be removed from `eslint-plugin/recommended`: https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/284
'jest/no-disabled-tests': 'warn',
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-alias-methods': 'error',
'jest/no-identical-title': 'error',
'jest/no-jasmine-globals': 'error',
'jest/no-test-prefixes': 'error',
'jest/no-done-callback': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-to-be': 'warn',
'jest/prefer-to-contain': 'warn',
'jest/prefer-to-have-length': 'warn',
'jest/prefer-to-be': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'jest/prefer-spy-on': 'error',
'jest/valid-expect': 'error',
'jest/no-deprecated-functions': 'error',
Expand Down Expand Up @@ -315,7 +334,12 @@ module.exports = {
},
// tools and tests
{
files: ['**/tools/**/*.ts', '**/tests/**/*.ts'],
files: [
'**/tools/**/*.*t*',
'**/tests/**/*.ts',
'./packages/repo-tools/**/*.*t*',
'./packages/integration-tests/**/*.*t*',
],
rules: {
// allow console logs in tools and tests
'no-console': 'off',
Expand All @@ -342,25 +366,39 @@ module.exports = {
'@typescript-eslint/sort-type-constituents': 'error',
},
},
{
files: ['./packages/ast-spec/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
{
name: '@typescript-eslint/typescript-estree',
message:
'To prevent nx build errors, all `typescript-estree` imports should be done via `packages/ast-spec/tests/util/parsers/typescript-estree-import.ts`.',
},
],
},
},
{
files: ['rollup.config.ts'],
rules: {
'import/no-default-export': 'off',
},
},
{
files: ['./packages/website/'],
files: ['./packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'],
extends: [
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
plugins: ['jsx-a11y', 'react', 'react-hooks'],
rules: {
'@typescript-eslint/internal/prefer-ast-types-enum': 'off',
'import/no-default-export': 'off',
'react/jsx-no-target-blank': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/internal/prefer-ast-types-enum': 'off',
'react-hooks/exhaustive-deps': 'off', // TODO: enable it later
'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later
},
settings: {
react: {
Expand All @@ -376,5 +414,12 @@ module.exports = {
'no-console': 'off',
},
},
{
files: ['./packages/website-eslint/src/mock/**/*.js', '*.d.ts'],
rules: {
// mocks and declaration files have to mirror their original package
'import/no-default-export': 'off',
},
},
],
};
3 changes: 2 additions & 1 deletion .github/DISCUSSION_TEMPLATE/rfcs.yml
Expand Up @@ -14,11 +14,12 @@ body:
- 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 [read the discussions guidelines](https://typescript-eslint.io/contributing/discussions) and per those guidelines, this fits a discussion category, _not_ a help request or standard issue.
required: true
- 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
25 changes: 25 additions & 0 deletions .github/DISCUSSION_TEMPLATE/technical-discussions.yml
@@ -0,0 +1,25 @@
body:
- attributes:
label: Body
value: |
Body of the technical discussion...
id: body
type: textarea
- attributes:
label: Additional Info
value: |
Any additional info...
id: additional
type: textarea
- attributes:
label: Before you submit your discussion, 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 [read the discussions guidelines](https://typescript-eslint.io/contributing/discussions) and per those guidelines, this fits a discussion category, _not_ a help request or standard issue.
required: true
- 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
title: Your Title Here
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/06-bug-report-other.yaml
Expand Up @@ -36,6 +36,7 @@ body:
- ast-spec
- eslint-plugin-tslint
- parser
- rule-tester
- scope-manager
- typescript-estree
- utils
Expand Down Expand Up @@ -118,6 +119,7 @@ body:
| -------------------------------------- | ------- |
| `@typescript-eslint/eslint-plugin` | `X.Y.Z` |
| `@typescript-eslint/parser` | `X.Y.Z` |
| `@typescript-eslint/rule-tester` | `X.Y.Z` |
| `@typescript-eslint/scope-manager` | `X.Y.Z` |
| `@typescript-eslint/typescript-estree` | `X.Y.Z` |
| `@typescript-eslint/type-utils` | `X.Y.Z` |
Expand Down
22 changes: 18 additions & 4 deletions .github/actions/prepare-build/action.yml
Expand Up @@ -10,13 +10,27 @@ runs:
id: build-cache
with:
path: '**/dist/**'
key: ${{ runner.os }}-build-${{ github.ref }}
key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.run_id }}
# We don't want to share builds across runs even for the same branch
# because each commit can have different build artifacts and we don't
# want to accidentally share artifacts and poison the build output
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-build-${{ github.ref }}-${{ github.run_id }}
# If the cache was hit, then we still run the types build because we generate source files
- name: Build AST Spec
if: steps['build-cache'].outputs.cache-hit == 'true'
shell: bash
run: |
npx nx run types:build
env:
SKIP_AST_SPEC_REBUILD: true

# if the cache was hit - this will run in <1s
- name: Build
if: steps['build-cache'].outputs.cache-hit != 'true'
shell: bash
# Website will be built by the Netlify GitHub App
run: |
npx nx run-many --target=build --parallel --exclude website
npx nx run-many --target=build --parallel --exclude=website --exclude=website-eslint
env:
SKIP_AST_SPEC_REBUILD: true
15 changes: 15 additions & 0 deletions .github/actions/wait-for-netlify/action.yml
@@ -0,0 +1,15 @@
name: Wait for the Netlify deployment for the current commit to be ready
description: Wait for the Netlify deployment for the current commit to be ready

inputs:
netlify_token:
description: The value of secrets.NETLIFY_TOKEN
required: true
max_timeout:
description: The maximum length of time to keep retrying the Netlify api
retry_interval:
description: How long to wait between retries of the Netlify api

runs:
using: node16
main: index.js

0 comments on commit 081e79f

Please sign in to comment.