From bfe62d7abbc81797bccbe4cb197384e604ef7dfa Mon Sep 17 00:00:00 2001 From: Martin Hochel Date: Tue, 28 May 2024 12:43:51 +0200 Subject: [PATCH] chore(lint-staged): normalize source to live under /src --- lint-staged.config.js | 2 +- scripts/lint-staged/package.json | 2 +- scripts/lint-staged/project.json | 2 +- scripts/lint-staged/{ => src}/eslint-for-package.js | 0 scripts/lint-staged/{ => src}/eslint.js | 0 scripts/lint-staged/tsconfig.lib.json | 2 +- scripts/monorepo/src/eslint-constants.js | 2 +- 7 files changed, 5 insertions(+), 5 deletions(-) rename scripts/lint-staged/{ => src}/eslint-for-package.js (100%) rename scripts/lint-staged/{ => src}/eslint.js (100%) diff --git a/lint-staged.config.js b/lint-staged.config.js index 93243d88b17b22..39d0b6f62b71a3 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -10,7 +10,7 @@ const commands = { * - respect ignore files (which eslint doesn't do by default when passed a specific file path) * - match the set of files that are linted by the package's normal `lint` command */ - lint: 'node ./scripts/lint-staged/eslint', + lint: 'node ./scripts/lint-staged/src/eslint', }; // https://www.npmjs.com/package/lint-staged diff --git a/scripts/lint-staged/package.json b/scripts/lint-staged/package.json index 2028a93568e299..6857f424079351 100644 --- a/scripts/lint-staged/package.json +++ b/scripts/lint-staged/package.json @@ -6,7 +6,7 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", "type-check": "just-scripts type-check" }, diff --git a/scripts/lint-staged/project.json b/scripts/lint-staged/project.json index 75f25449c3c7f5..59c39db6114f9d 100644 --- a/scripts/lint-staged/project.json +++ b/scripts/lint-staged/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-lint-staged", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/lint-staged", + "sourceRoot": "scripts/lint-staged/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/lint-staged/eslint-for-package.js b/scripts/lint-staged/src/eslint-for-package.js similarity index 100% rename from scripts/lint-staged/eslint-for-package.js rename to scripts/lint-staged/src/eslint-for-package.js diff --git a/scripts/lint-staged/eslint.js b/scripts/lint-staged/src/eslint.js similarity index 100% rename from scripts/lint-staged/eslint.js rename to scripts/lint-staged/src/eslint.js diff --git a/scripts/lint-staged/tsconfig.lib.json b/scripts/lint-staged/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/lint-staged/tsconfig.lib.json +++ b/scripts/lint-staged/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/monorepo/src/eslint-constants.js b/scripts/monorepo/src/eslint-constants.js index 6e132278f87ee8..b5ec79c2ce74b5 100644 --- a/scripts/monorepo/src/eslint-constants.js +++ b/scripts/monorepo/src/eslint-constants.js @@ -1,4 +1,4 @@ -/** Constants used by the eslint task and scripts/lint-staged/eslint-for-package.js */ +/** Constants used by the eslint task and {@link file://./../../lint-staged/src/eslint-for-package.js } */ module.exports = { /** List of file extensions to lint, in format used by eslint (comma-separated, with leading .) */ extensions: '.ts,.tsx,.js,.jsx',