Skip to content

Commit 8fc34f7

Browse files
Merge pull request #66 from darkmavis1980/feature/upgrade-linting
Feature/upgrade linting
2 parents 2318b3b + c7ca0bc commit 8fc34f7

File tree

23 files changed

+4566
-3909
lines changed

23 files changed

+4566
-3909
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
node: [ 18, 20 ]
22+
node: [ 20, 22 ]
2323
# Steps represent a sequence of tasks that will be executed as part of the job
2424
name: Build for Node ${{ matrix.node }} version
2525
steps:

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
node: [ 18, 20 ]
19+
node: [ 20, 22 ]
2020

2121
name: Build for Node ${{ matrix.node }} version
2222
steps:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-node@v4
1212
with:
13-
node-version: 20
13+
node-version: 22
1414
registry-url: 'https://registry.npmjs.org'
1515
- run: npm install
1616
- run: npm publish

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ node_modules
99
.npmrc
1010
coverage
1111
.DS_Store
12-
.vscode
12+
.vscode
13+
tsconfig.tsbuildinfo

.mocharc.json

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

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "all",
6+
"printWidth": 120,
7+
"bracketSpacing": true,
8+
"arrowParens": "avoid",
9+
"endOfLine": "lf",
10+
"singleAttributePerLine": true
11+
}

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
# Changelog
22

3-
## [v2.1.1](https://github.com/darkmavis1980/markdown-index-generator/compare/v2.1.0...v2.1.1)
3+
## [v3.0.0](https://github.com/darkmavis1980/markdown-index-generator/compare/v2.1.1...v3.0.0)
4+
5+
### Merged
6+
7+
- Bugfix/fix issue with title [`#65`](https://github.com/darkmavis1980/markdown-index-generator/pull/65)
8+
9+
### Commits
10+
11+
- feat: remove legacy packages [`90b249e`](https://github.com/darkmavis1980/markdown-index-generator/commit/90b249eb537b1efc283556383c4baf9f5beffcbd)
12+
- chore: update dependency [`5f5bcc6`](https://github.com/darkmavis1980/markdown-index-generator/commit/5f5bcc6ba28818d549e84f90fb01bb2ea61032b9)
13+
- feat: add tsx [`fb3a425`](https://github.com/darkmavis1980/markdown-index-generator/commit/fb3a4255b321a005431147b09c432c3f3b16a75b)
14+
- fix: add missing package [`1db784c`](https://github.com/darkmavis1980/markdown-index-generator/commit/1db784c2a921996e64fddf11e1114c1f7b967b01)
15+
- fix: cleaned up code [`ce7e97b`](https://github.com/darkmavis1980/markdown-index-generator/commit/ce7e97b3fb21ae5e71cf13bd2b1d8a1084313690)
16+
- fix: add missing package [`c024b12`](https://github.com/darkmavis1980/markdown-index-generator/commit/c024b12d378c845a1434a0ff837257f69a3e5326)
17+
- feat: add prettier [`67ee3c5`](https://github.com/darkmavis1980/markdown-index-generator/commit/67ee3c5de749eaf9a6045aa9b5c1e8aed55f7255)
18+
- feat: upgrade commander to latest version [`d99fb91`](https://github.com/darkmavis1980/markdown-index-generator/commit/d99fb910b49af7500eb50938f08726c3854b4dec)
19+
- chore: removed legacy mocha configuration [`5c77682`](https://github.com/darkmavis1980/markdown-index-generator/commit/5c776828935a92136f5bfc1d492b20c0fe40c4f6)
20+
- fix: update code to use ESM [`5443145`](https://github.com/darkmavis1980/markdown-index-generator/commit/5443145531ebdca5c5890b30b5086e4c4a31a126)
21+
22+
## [v2.1.1](https://github.com/darkmavis1980/markdown-index-generator/compare/v2.1.0...v2.1.1) - 2024-07-31
423

524
### Merged
625

babel.config.js

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

bin/run

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/bin/env node
1+
#!/usr/bin/env npx tsx
22

3-
const { program } = require('commander');
4-
const { version } = require('../package.json');
5-
const MarkdownIndexGenerator = require('../lib/index.js');
3+
import { program } from 'commander';
4+
import { version } from '../package.json';
5+
import MarkdownIndexGenerator from '../lib/index.js';
66

77
program
88
.version(version)

eslint.config.mjs

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,63 @@
1-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2-
import tsParser from "@typescript-eslint/parser";
3-
import path from "node:path";
4-
import { fileURLToPath } from "node:url";
5-
import js from "@eslint/js";
6-
import { FlatCompat } from "@eslint/eslintrc";
1+
import importPlugin from 'eslint-plugin-import';
2+
import globals from 'globals';
3+
import tsParser from '@typescript-eslint/parser';
4+
import eslintJs from '@eslint/js';
5+
import eslintTs from 'typescript-eslint';
76

8-
const __filename = fileURLToPath(import.meta.url);
9-
const __dirname = path.dirname(__filename);
10-
const compat = new FlatCompat({
11-
baseDirectory: __dirname,
12-
recommendedConfig: js.configs.recommended,
13-
allConfig: js.configs.all
14-
});
7+
const tsFiles = ['{src,test}/**/*.ts'];
158

16-
export default [{
17-
ignores: ["lib", "**/*.d.ts"],
18-
}, ...compat.extends(
19-
"eslint:recommended",
20-
"plugin:@typescript-eslint/eslint-recommended",
21-
"plugin:@typescript-eslint/recommended",
22-
).map(config => ({
23-
...config,
24-
files: ["**/*.ts", "**/*.tsx"],
25-
})), {
26-
files: ["**/*.ts", "**/*.tsx"],
9+
const languageOptions = {
10+
globals: {
11+
...globals.node,
12+
...globals.jest,
13+
},
14+
ecmaVersion: 2023,
15+
sourceType: 'module',
16+
};
2717

18+
const customTypescriptConfig = {
19+
files: tsFiles,
2820
plugins: {
29-
"@typescript-eslint": typescriptEslint,
21+
import: importPlugin,
22+
'import/parsers': tsParser,
3023
},
31-
3224
languageOptions: {
25+
...languageOptions,
3326
parser: tsParser,
27+
parserOptions: {
28+
project: './tsconfig.json',
29+
},
30+
},
31+
settings: {
32+
'import/parsers': {
33+
'@typescript-eslint/parser': ['.ts'],
34+
},
3435
},
35-
3636
rules: {
3737
"no-console": "off",
38+
"@typescript-eslint/no-explicit-any": "off",
3839
},
39-
}];
40+
ignores: ['/lib'],
41+
};
42+
43+
// Add the files for applying the recommended TypeScript configs
44+
// only for the Typescript files.
45+
// This is necessary when we have the multiple extensions files
46+
// (e.g. .ts, .tsx, .js, .cjs, .mjs, etc.).
47+
const recommendedTypeScriptConfigs = [
48+
...eslintTs.configs.recommended.map((config) => ({
49+
...config,
50+
files: tsFiles,
51+
})),
52+
...eslintTs.configs.stylistic.map((config) => ({
53+
...config,
54+
files: tsFiles,
55+
})),
56+
];
57+
58+
export default [
59+
{ ignores: ['docs/*', 'build/*', 'lib/*', 'dist/*'] }, // global ignores
60+
eslintJs.configs.recommended,
61+
...recommendedTypeScriptConfigs,
62+
customTypescriptConfig,
63+
];

0 commit comments

Comments
 (0)