Merge pull request #1133 from actions/ncalteen/projectService

Switch to ESLint projectService
This commit is contained in:
Nick Alteen
2025-10-31 11:26:51 -04:00
committed by GitHub
7 changed files with 57 additions and 95 deletions

View File

@@ -11,34 +11,32 @@ it is generated from.
## Repository Structure
| Path | Description |
| ---------------------- | -------------------------------------------------------- |
| `__fixtures__/` | Unit Test Fixtures |
| `__tests__/` | Unit Tests |
| `.devcontainer/` | Development Container Configuration |
| `.github/` | GitHub Configuration |
| `.licenses/` | License Information |
| `.vscode/` | Visual Studio Code Configuration |
| `badges/` | Badges for readme |
| `dist/` | Generated JavaScript Code |
| `src/` | TypeScript Source Code |
| `.env.example` | Environment Variables Example for `@github/local-action` |
| `.licensed.yml` | Licensed Configuration |
| `.markdown-lint.yml` | Markdown Linter Configuration |
| `.node-version` | Node.js Version Configuration |
| `.prettierrc.yml` | Prettier Formatter Configuration |
| `.yaml-lint.yml` | YAML Linter Configuration |
| `action.yml` | GitHub Action Metadata |
| `CODEOWNERS` | Code Owners File |
| `eslint.config.mjs` | ESLint Configuration |
| `jest.config.js` | Jest Configuration |
| `LICENSE` | License File |
| `package.json` | NPM Package Configuration |
| `README.md` | Project Documentation |
| `rollup.config.ts` | Rollup Bundler Configuration |
| `tsconfig.base.json` | Base TypeScript Configuration |
| `tsconfig.eslint.json` | TypeScript Configuration for ESLint |
| `tsconfig.json` | TypeScript Configuration |
| Path | Description |
| -------------------- | -------------------------------------------------------- |
| `__fixtures__/` | Unit Test Fixtures |
| `__tests__/` | Unit Tests |
| `.devcontainer/` | Development Container Configuration |
| `.github/` | GitHub Configuration |
| `.licenses/` | License Information |
| `.vscode/` | Visual Studio Code Configuration |
| `badges/` | Badges for readme |
| `dist/` | Generated JavaScript Code |
| `src/` | TypeScript Source Code |
| `.env.example` | Environment Variables Example for `@github/local-action` |
| `.licensed.yml` | Licensed Configuration |
| `.markdown-lint.yml` | Markdown Linter Configuration |
| `.node-version` | Node.js Version Configuration |
| `.prettierrc.yml` | Prettier Formatter Configuration |
| `.yaml-lint.yml` | YAML Linter Configuration |
| `action.yml` | GitHub Action Metadata |
| `CODEOWNERS` | Code Owners File |
| `eslint.config.mjs` | ESLint Configuration |
| `jest.config.js` | Jest Configuration |
| `LICENSE` | License File |
| `package.json` | NPM Package Configuration |
| `README.md` | Project Documentation |
| `rollup.config.ts` | Rollup Bundler Configuration |
| `tsconfig.json` | TypeScript Configuration |
## Environment Setup

View File

@@ -9,13 +9,9 @@ import _import from 'eslint-plugin-import'
import jest from 'eslint-plugin-jest'
import prettier from 'eslint-plugin-prettier'
import globals from 'globals'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
baseDirectory: import.meta.dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
})
@@ -52,8 +48,16 @@ export default [
sourceType: 'module',
parserOptions: {
project: ['tsconfig.eslint.json'],
tsconfigRootDir: __dirname
projectService: {
allowDefaultProject: [
'__fixtures__/*.ts',
'__tests__/*.ts',
'eslint.config.mjs',
'jest.config.js',
'rollup.config.ts'
]
},
tsconfigRootDir: import.meta.dirname
}
},
@@ -61,7 +65,7 @@ export default [
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.eslint.json'
project: 'tsconfig.json'
}
}
},

View File

@@ -31,7 +31,7 @@ export default {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.eslint.json',
tsconfig: 'tsconfig.json',
useESM: true
}
]

17
package-lock.json generated
View File

@@ -9,8 +9,7 @@
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.11.1",
"@rollup/rollup-linux-x64-gnu": "*"
"@actions/core": "^1.11.1"
},
"devDependencies": {
"@eslint/compat": "^1.4.0",
@@ -13146,20 +13145,6 @@
"fsevents": "~2.3.2"
}
},
"node_modules/rollup/node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.52.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.4.tgz",
"integrity": "sha512-Wi6AXf0k0L7E2gteNsNHUs7UMwCIhsCTs6+tqQ5GPwVRWMaflqGec4Sd8n6+FNFDw9vGcReqk2KzBDhCa1DLYg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",

View File

@@ -1,23 +0,0 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"declarationMap": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"newLine": "lf",
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"pretty": true,
"resolveJsonModule": true,
"strict": true,
"strictNullChecks": true,
"target": "ES2022"
}
}

View File

@@ -1,17 +0,0 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"noEmit": true
},
"exclude": ["dist", "node_modules"],
"include": [
"__fixtures__",
"__tests__",
"src",
"eslint.config.mjs",
"jest.config.js",
"rollup.config.ts"
]
}

View File

@@ -1,10 +1,25 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"declarationMap": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "./dist"
"newLine": "lf",
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"outDir": "./dist",
"pretty": true,
"resolveJsonModule": true,
"strict": true,
"strictNullChecks": true,
"target": "ES2022"
},
"exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"],
"include": ["src"]