Skip to content

Commit

Permalink
Merge branch 'v6'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Oct 26, 2022
2 parents 7ca78b1 + 04488c2 commit a69faeb
Show file tree
Hide file tree
Showing 2,135 changed files with 97,096 additions and 44,122 deletions.
413 changes: 0 additions & 413 deletions .all-contributorsrc

This file was deleted.

17 changes: 12 additions & 5 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"**/*.{json,snap}",
"**/**/CHANGELOG.md",
"**/**/CONTRIBUTORS.md",
"**/**/ROADMAP.md",
"**/**/TSLINT_RULE_ALTERNATIVES.md",
"**/coverage/**",
"**/dist/**",
"**/fixtures/**",
Expand Down Expand Up @@ -52,13 +52,15 @@
"bivariant",
"blockless",
"camelcase",
"Cena",
"codebases",
"Codecov",
"contravariant",
"Crockford",
"declarators",
"destructure",
"destructured",
"dprint",
"errored",
"erroring",
"ESLint",
Expand All @@ -71,10 +73,12 @@
"IIFE",
"IIFEs",
"linebreaks",
"markdownlint",
"lzstring",
"markdownlint",
"metastring",
"necroing",
"nocheck",
"noninteractive",
"nullish",
"OOM",
"OOMs",
Expand All @@ -86,6 +90,7 @@
"preact",
"Premade",
"prettier's",
"Quickstart",
"recurse",
"redeclaration",
"redeclarations",
Expand All @@ -101,19 +106,21 @@
"transpiled",
"transpiles",
"transpiling",
"tsvfs",
"tsconfigs",
"tsutils",
"tsvfs",
"typedef",
"typedefs",
"unfixable",
"unoptimized",
"unprefixed",
"Zacher"
"upsert",
"Zacher",
"tseslint"
],
"overrides": [
{
"filename": "**/*.{ts,js,tsx,jsx}",
"filename": "**/*.{ts,mts,cts,js,cjs,mjs,tsx,jsx}",
"ignoreRegExpList": ["/@[a-z]+/", "/#(end)?region/"],
"includeRegExpList": [
"/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/",
Expand Down
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules
dist
jest.config.js
commitlint.config.js
fixtures
shared-fixtures
coverage
Expand All @@ -17,4 +16,4 @@ packages/website-eslint/**/*.js
packages/website-eslint/**/*.d.ts

# Files copied as part of the build
packages/types/src/ast-spec.ts
packages/types/src/generated/**/*.ts
118 changes: 76 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module.exports = {
root: true,
plugins: [
'eslint-plugin',
'@typescript-eslint',
'jest',
'import',
'eslint-comments',
'@typescript-eslint/internal',
'deprecation',
'eslint-comments',
'eslint-plugin',
'import',
'jest',
'simple-import-sort',
],
env: {
Expand All @@ -15,6 +16,7 @@ module.exports = {
},
extends: [
'eslint:recommended',
'plugin:eslint-plugin/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
Expand All @@ -24,13 +26,25 @@ module.exports = {
'./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
* files here for now in addition to the tsconfig.json glob pattern.
*
* TODO(#4665): Clean this up once all packages have been transitioned.
*/
'./packages/scope-manager/tsconfig.build.json',
'./packages/scope-manager/tsconfig.spec.json',
],
allowAutomaticSingleRunInference: true,
tsconfigRootDir: __dirname,
warnOnUnsupportedTypeScriptVersion: false,
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false,
},
rules: {
// make sure we're not leveraging any deprecated APIs
'deprecation/deprecation': 'error',

//
// our plugin :D
//
Expand All @@ -46,6 +60,10 @@ module.exports = {
},
],
'@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': [
Expand All @@ -55,6 +73,7 @@ module.exports = {
'@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',
Expand All @@ -74,9 +93,6 @@ module.exports = {
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],

// TODO - enable this
'@typescript-eslint/naming-convention': 'off',

//
// Internal repo rules
//
Expand Down Expand Up @@ -144,8 +160,10 @@ module.exports = {
'import/no-absolute-path': 'error',
// disallow AMD require/define
'import/no-amd': 'error',
// forbid default exports
// forbid default exports - we want to standardize on named exports so that imported names are consistent
'import/no-default-export': 'error',
// disallow imports from duplicate paths
'import/no-duplicates': 'error',
// Forbid the use of extraneous packages
'import/no-extraneous-dependencies': [
'error',
Expand All @@ -165,19 +183,22 @@ module.exports = {
'import/no-self-import': 'error',
// Require modules with a single export to use a default export
'import/prefer-default-export': 'off', // we want everything to be named

// enforce a sort order across the codebase
'simple-import-sort/imports': 'error',
},
overrides: [
// all test files
{
files: [
'packages/*/tests/**/*.spec.ts',
'packages/*/tests/**/*.test.ts',
'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/*/tests/**/*.spec.ts',
'./packages/*/tests/**/*.test.ts',
'./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',
],
env: {
'jest/globals': true,
Expand All @@ -187,7 +208,7 @@ module.exports = {
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'eslint-plugin/no-identical-tests': 'error',
'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-focused-tests': 'error',
'jest/no-alias-methods': 'error',
Expand Down Expand Up @@ -219,9 +240,9 @@ module.exports = {
// plugin source files
{
files: [
'packages/eslint-plugin-internal/**/*.ts',
'packages/eslint-plugin-tslint/**/*.ts',
'packages/eslint-plugin/**/*.ts',
'./packages/eslint-plugin-internal/**/*.ts',
'./packages/eslint-plugin-tslint/**/*.ts',
'./packages/eslint-plugin/**/*.ts',
],
rules: {
'@typescript-eslint/internal/no-typescript-estree-import': 'error',
Expand All @@ -230,10 +251,10 @@ module.exports = {
// plugin rule source files
{
files: [
'packages/eslint-plugin-internal/src/rules/**/*.ts',
'packages/eslint-plugin-tslint/src/rules/**/*.ts',
'packages/eslint-plugin/src/configs/**/*.ts',
'packages/eslint-plugin/src/rules/**/*.ts',
'./packages/eslint-plugin-internal/src/rules/**/*.ts',
'./packages/eslint-plugin-tslint/src/rules/**/*.ts',
'./packages/eslint-plugin/src/configs/**/*.ts',
'./packages/eslint-plugin/src/rules/**/*.ts',
],
rules: {
// specifically for rules - default exports makes the tooling easier
Expand All @@ -243,18 +264,18 @@ module.exports = {
// plugin rule tests
{
files: [
'packages/eslint-plugin-internal/tests/rules/**/*.test.ts',
'packages/eslint-plugin-tslint/tests/rules/**/*.test.ts',
'packages/eslint-plugin/tests/rules/**/*.test.ts',
'packages/eslint-plugin/tests/eslint-rules/**/*.test.ts',
'./packages/eslint-plugin-internal/tests/rules/**/*.test.ts',
'./packages/eslint-plugin-tslint/tests/rules/**/*.test.ts',
'./packages/eslint-plugin/tests/rules/**/*.test.ts',
'./packages/eslint-plugin/tests/eslint-rules/**/*.test.ts',
],
rules: {
'@typescript-eslint/internal/plugin-test-formatting': 'error',
},
},
// files which list all the things
{
files: ['packages/eslint-plugin/src/rules/index.ts'],
files: ['./packages/eslint-plugin/src/rules/index.ts'],
rules: {
// enforce alphabetical ordering
'sort-keys': 'error',
Expand All @@ -272,30 +293,22 @@ module.exports = {
// generated files
{
files: [
'packages/scope-manager/src/lib/*.ts',
'packages/eslint-plugin/src/configs/*.ts',
'./packages/scope-manager/src/lib/*.ts',
'./packages/eslint-plugin/src/configs/*.ts',
],
rules: {
// allow console logs in tools and tests
'@typescript-eslint/internal/no-poorly-typed-ts-props': 'off',
'@typescript-eslint/internal/no-typescript-default-import': 'off',
'@typescript-eslint/internal/prefer-ast-types-enum': 'off',
},
},
// ast spec specific standardization
{
files: ['packages/ast-spec/src/**/*.ts'],
files: ['./packages/ast-spec/src/**/*.ts'],
rules: {
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', disallowTypeAnnotations: true },
],
// disallow ALL unused vars
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/sort-type-union-intersection-members': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'simple-import-sort/imports': 'error',
},
},
{
Expand All @@ -305,9 +318,30 @@ module.exports = {
},
},
{
files: ['packages/website/src/**/*.{ts,tsx}'],
files: ['./packages/website/'],
extends: [
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
plugins: ['jsx-a11y', 'react', 'react-hooks'],
rules: {
'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
},
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['./packages/website/src/**/*.{ts,tsx}'],
rules: {
'import/no-default-export': 'off',
// allow console logs in the website to help with debugging things in production
'no-console': 'off',
},
},
Expand Down

0 comments on commit a69faeb

Please sign in to comment.