diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb203c7..ac66648 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ npm run type-check # TypeScript without emitting files npm test # Vitest unit tests npx vitest run --coverage # what CI runs: tests plus the coverage gate npm run check-links # internal docs links -npm run lint # ESLint for src/ +npm run lint # ESLint for src/, scripts/ and netlify/ npm run build # production build and doc-sync scripts ``` diff --git a/changelog.d/changed-lint-scripts-netlify.md b/changelog.d/changed-lint-scripts-netlify.md new file mode 100644 index 0000000..3edacdb --- /dev/null +++ b/changelog.d/changed-lint-scripts-netlify.md @@ -0,0 +1 @@ +- Run ESLint over `scripts/` and `netlify/` as well as `src/` (`npm run lint`), parse `.mts` files with the TypeScript parser, and allow `console` output in those CLI/serverless entry points (#218). diff --git a/eslint.config.mjs b/eslint.config.mjs index e96ceb9..5b07111 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -13,7 +13,7 @@ export default [ }, js.configs.recommended, { - files: ["**/*.{js,jsx,ts,tsx}"], + files: ["**/*.{js,jsx,ts,tsx,mts}"], languageOptions: { parser: typescriptEslintParser, parserOptions: { @@ -120,4 +120,12 @@ export default [ "jsx-a11y/no-static-element-interactions": "warn", }, }, + { + // Build/sync scripts and the Netlify function are CLI and serverless + // entry points: console.log is their output channel, not a leftover. + files: ["scripts/**/*.{js,ts}", "netlify/**/*.{js,ts,mts}"], + rules: { + "no-console": "off", + }, + }, ]; diff --git a/package.json b/package.json index 7b5c68a..6dd5b66 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "prebuild": "(tsx scripts/update-meeting-recordings.ts || echo \"meeting recordings refresh unavailable - using committed data\") && (tsx scripts/sync-hive-docs.ts || echo \"hive docs sync unavailable - using committed content\") && (tsx scripts/sync-sibling-docs.ts || echo \"sibling docs sync unavailable - using committed content\") && tsx scripts/generate-shared-config.ts", "build": "next build", "start": "next start", - "lint": "eslint src/", - "lint:fix": "eslint src/ --fix", + "lint": "eslint src/ scripts/ netlify/", + "lint:fix": "eslint src/ scripts/ netlify/ --fix", "lint:md": "markdownlint-cli2 \"README.md\" \"CONTRIBUTING.md\" \"docs/**/*.{md,mdx}\" \"src/**/*.{md,mdx}\"", "sync-hive-docs": "tsx scripts/sync-hive-docs.ts", "check-links": "tsx scripts/check-internal-links.ts",