Skip to content

Commit 325088c

Browse files
dhensbyCopilot
andcommitted
chore: upgrade ESLint to v10 with flat config
Migrate from ESLint v8 with legacy .eslintrc.json to ESLint v10 with flat config (eslint.config.mjs). - Replace eslint v8 with v10, @typescript-eslint/parser and @typescript-eslint/eslint-plugin with the unified typescript-eslint package - Convert .eslintrc.json to eslint.config.mjs using tseslint.config() - Move .eslintignore entries into the flat config ignores property - Remove --config flag from lint script (flat config is auto-detected) - Fix lint errors caught by new rules (trailing commas in generate-docs.ts, useless assignment) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2dc24a2 commit 325088c

6 files changed

Lines changed: 597 additions & 660 deletions

File tree

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
4+
export default tseslint.config(
5+
{
6+
ignores: ['lib/'],
7+
},
8+
eslint.configs.recommended,
9+
tseslint.configs.recommended,
10+
{
11+
rules: {
12+
'comma-dangle': ['error', 'always-multiline'],
13+
'no-shadow': ['error'],
14+
'semi': ['error', 'always'],
15+
},
16+
},
17+
{
18+
files: ['test/**/*'],
19+
rules: {
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
},
22+
},
23+
);

misc/generate-docs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function updateUsage(
4141
actionYamlPath = 'action.yml',
4242
readmePath = 'README.md',
4343
startToken = '<!-- start usage -->',
44-
endToken = '<!-- end usage -->'
44+
endToken = '<!-- end usage -->',
4545
): Promise<void> {
4646
if (!actionReference) {
4747
throw new Error('Parameter actionReference must not be empty');
@@ -105,7 +105,7 @@ async function updateUsage(
105105
.replace(/ \n/g, '\n'); // Squash space followed by newline
106106
while (description) {
107107
// Longer than width? Find a space to break apart
108-
let segment: string = description;
108+
let segment: string;
109109
if (description.length > width) {
110110
segment = description.substr(0, width + 1);
111111
while (!segment.endsWith(' ') && !segment.endsWith('\n') && segment) {
@@ -170,5 +170,5 @@ async function updateUsage(
170170
updateUsage(
171171
`tediousjs/setup-sqlserver@v${version.split('.')[0]}`,
172172
path.join(__dirname, '..', 'action.yml'),
173-
path.join(__dirname, '..', 'README.md')
173+
path.join(__dirname, '..', 'README.md'),
174174
);

0 commit comments

Comments
 (0)