From 7c3f8cc8acc26f4b6c01a04c381e40ad4e00ff70 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 24 Jan 2024 12:08:25 +0800 Subject: [PATCH] chore: add `core` package scaffold --- .../ISSUE_TEMPLATE/06-bug-report-other.yaml | 1 + .../ISSUE_TEMPLATE/07-enhancement-other.yaml | 1 + .github/workflows/ci.yml | 1 + .github/workflows/semantic-pr-titles.yml | 1 + package.json | 2 + packages/typescript-eslint/LICENCE | 21 +++++ packages/typescript-eslint/README.md | 12 +++ packages/typescript-eslint/package.json | 83 +++++++++++++++++++ packages/typescript-eslint/project.json | 15 ++++ packages/typescript-eslint/src/index.ts | 2 + .../typescript-eslint/tsconfig.build.json | 11 +++ packages/typescript-eslint/tsconfig.json | 10 +++ yarn.lock | 21 +++++ 13 files changed, 181 insertions(+) create mode 100644 packages/typescript-eslint/LICENCE create mode 100644 packages/typescript-eslint/README.md create mode 100644 packages/typescript-eslint/package.json create mode 100644 packages/typescript-eslint/project.json create mode 100644 packages/typescript-eslint/src/index.ts create mode 100644 packages/typescript-eslint/tsconfig.build.json create mode 100644 packages/typescript-eslint/tsconfig.json diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml index a7da8ab04c37..c3ab6ee8df3b 100644 --- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml +++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml @@ -38,6 +38,7 @@ body: - parser - rule-tester - scope-manager + - typescript-eslint - typescript-estree - utils - website diff --git a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml index f383970cf440..b3ae91962b1c 100644 --- a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml +++ b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml @@ -28,6 +28,7 @@ body: - parser - scope-manager - type-utils + - typescript-eslint - typescript-estree - utils - website diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 260e5e6ba14c..9951a2cc4bcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,6 +171,7 @@ jobs: 'rule-schema-to-typescript-types', 'scope-manager', 'type-utils', + 'typescript-eslint', 'typescript-estree', 'utils', 'visitor-keys', diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/semantic-pr-titles.yml index 3ebb03d6fb2a..fceee3e45519 100644 --- a/.github/workflows/semantic-pr-titles.yml +++ b/.github/workflows/semantic-pr-titles.yml @@ -35,6 +35,7 @@ jobs: scope-manager type-utils types + typescript-eslint typescript-estree utils visitor-keys diff --git a/package.json b/package.json index 5bfe9b4181e6..a684e231281c 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "@types/semver": "^7.5.0", "@types/tmp": "^0.2.3", "@types/yargs": "^17.0.32", + "@typescript-eslint/eslint-plugin-internal": "workspace:packages/eslint-plugin-internal", "console-fail-test": "^0.2.3", "cross-fetch": "^4.0.0", "cspell": "^7.0.0", @@ -117,6 +118,7 @@ "tslint": "^6.1.3", "tsx": "^4.6.2", "typescript": ">=4.3.5 <5.4.0", + "typescript-eslint": "workspace:packages/typescript-eslint", "yargs": "17.7.2" }, "resolutions": { diff --git a/packages/typescript-eslint/LICENCE b/packages/typescript-eslint/LICENCE new file mode 100644 index 000000000000..a1164108d4d6 --- /dev/null +++ b/packages/typescript-eslint/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +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/packages/typescript-eslint/README.md b/packages/typescript-eslint/README.md new file mode 100644 index 000000000000..3c078eae2d4c --- /dev/null +++ b/packages/typescript-eslint/README.md @@ -0,0 +1,12 @@ +# `typescript-eslint` + +> Tooling which enables you to use TypeScript with ESLint + +[![NPM Version](https://img.shields.io/npm/v/typescript-eslint.svg?style=flat-square)](https://www.npmjs.com/package/typescript-eslint) +[![NPM Downloads](https://img.shields.io/npm/dm/typescript-eslint.svg?style=flat-square)](https://www.npmjs.com/package/typescript-eslint) + +👉 See **https://typescript-eslint.io/packages/typescript-eslint** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json new file mode 100644 index 000000000000..efd1b4486c46 --- /dev/null +++ b/packages/typescript-eslint/package.json @@ -0,0 +1,83 @@ +{ + "name": "typescript-eslint", + "version": "6.20.0", + "description": "Tooling which enables you to use TypeScript with ESLint", + "files": [ + "dist", + "_ts4.3", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "private": true, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/typescript-eslint" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax", + "eslint", + "eslintplugin", + "eslint-plugin" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "lint": "nx lint", + "test": "jest --coverage --passWithNoTests", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "dependencies": { + "@typescript-eslint/eslint-plugin": "6.20.0", + "@typescript-eslint/parser": "6.20.0" + }, + "devDependencies": { + "downlevel-dts": "*", + "jest": "29.7.0", + "prettier": "^3.0.3", + "rimraf": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/packages/typescript-eslint/project.json b/packages/typescript-eslint/project.json new file mode 100644 index 000000000000..75cd8266b5ec --- /dev/null +++ b/packages/typescript-eslint/project.json @@ -0,0 +1,15 @@ +{ + "name": "typescript-eslint", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "type": "library", + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nx/eslint:lint", + "outputs": ["{options.outputFile}"], + "options": { + "ignorePath": ".eslintignore" + } + } + } +} diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts new file mode 100644 index 000000000000..8a15f9183b55 --- /dev/null +++ b/packages/typescript-eslint/src/index.ts @@ -0,0 +1,2 @@ +// TODO(bradzacher) #7935 +export {}; diff --git a/packages/typescript-eslint/tsconfig.build.json b/packages/typescript-eslint/tsconfig.build.json new file mode 100644 index 000000000000..8833d225ce3c --- /dev/null +++ b/packages/typescript-eslint/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./dist", + "rootDir": "./src", + "resolveJsonModule": true + }, + "include": ["src"], + "references": [{ "path": "../parser/tsconfig.build.json" }] +} diff --git a/packages/typescript-eslint/tsconfig.json b/packages/typescript-eslint/tsconfig.json new file mode 100644 index 000000000000..ac9e78203f68 --- /dev/null +++ b/packages/typescript-eslint/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": false, + "rootDir": "." + }, + "include": ["src", "tests", "tools"], + "exclude": ["tests/fixtures"], + "references": [{ "path": "../parser/tsconfig.build.json" }] +} diff --git a/yarn.lock b/yarn.lock index 8318bd493dfe..a1c9a9cbec37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5645,6 +5645,7 @@ __metadata: "@types/semver": ^7.5.0 "@types/tmp": ^0.2.3 "@types/yargs": ^17.0.32 + "@typescript-eslint/eslint-plugin-internal": "workspace:packages/eslint-plugin-internal" console-fail-test: ^0.2.3 cross-fetch: ^4.0.0 cspell: ^7.0.0 @@ -5683,6 +5684,7 @@ __metadata: tslint: ^6.1.3 tsx: ^4.6.2 typescript: ">=4.3.5 <5.4.0" + typescript-eslint: "workspace:packages/typescript-eslint" yargs: 17.7.2 languageName: unknown linkType: soft @@ -18347,6 +18349,25 @@ __metadata: languageName: node linkType: hard +"typescript-eslint@workspace:packages/typescript-eslint": + version: 0.0.0-use.local + resolution: "typescript-eslint@workspace:packages/typescript-eslint" + dependencies: + "@typescript-eslint/eslint-plugin": 6.20.0 + "@typescript-eslint/parser": 6.20.0 + downlevel-dts: "*" + jest: 29.7.0 + prettier: ^3.0.3 + rimraf: "*" + typescript: "*" + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + typescript: + optional: true + languageName: unknown + linkType: soft + "typescript@npm:5.3.3": version: 5.3.3 resolution: "typescript@npm:5.3.3"