Skip to content

Commit

Permalink
chore: update to eslint v9, remove markdown lint due to complexity (#177
Browse files Browse the repository at this point in the history
)

* chore: update to eslint v9, remove markdown lint due to complexity

* fix: remove ignore comment
  • Loading branch information
dominikg committed Jun 11, 2024
1 parent 85aa391 commit b1d2f2a
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 206 deletions.
52 changes: 0 additions & 52 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ interface TSConfckFindAllOptions {
* helper to skip subdirectories when scanning for tsconfig.json
*
* eg ` dir => dir === 'node_modules' || dir === '.git'`
*/ // eslint-disable-next-line no-unused-vars
*/
skip?: (dir: string) => boolean;
/**
* list of config filenames to include, use ["tsconfig.json","jsconfig.json"] if you need both
Expand Down
43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import js from '@eslint/js';
import prettier from 'eslint-plugin-prettier';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import node from 'eslint-plugin-n';

export default [
js.configs.recommended,
node.configs['flat/recommended-module'],
prettierRecommended,
{
ignores: [
'packages/tsconfck/tests/fixtures/parse/invalid/**/*',
'packages/tsconfck/tests/fixtures/find-all/recursive-symlink/**/*',
'packages/tsconfck/tests/snapshots/**/*'
]
},
{
plugins: {
node,
prettier
}
},
{
languageOptions: {
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2022
}
},
rules: {
'no-debugger': ['error']
}
},
{
files: ['**/tests/fixtures/**/*.js', '**/tests/fixtures/**/*.ts'],
rules: {
'no-unused-vars': 'off'
}
}
];
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"check": "run-p -c check:*",
"check:publint": "pnpm --filter \"./packages/*\" --parallel check:publint",
"check:types": "pnpm --filter \"./packages/*\" --parallel check:types",
"check:lint": "eslint --cache --ignore-path .gitignore '**/*.{js,md}'",
"check:lint": "eslint --cache '**/*.{js,md}'",
"check:format": "prettier --cache --ignore-path .gitignore --ignore-path .prettierignore --ignore-unknown --check .",
"lint": "pnpm check:lint --fix",
"format": "pnpm check:format --write",
Expand All @@ -21,10 +21,11 @@
},
"devDependencies": {
"@changesets/cli": "^2.27.5",
"@eslint/js": "^9.4.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"dts-buddy": "^0.4.7",
"esbuild": "^0.21.5",
"eslint": "^8.57.0",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-markdown": "^5.0.0",
"eslint-plugin-n": "^17.8.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfck/src/parse-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function parseNative(filename, options) {
await parseReferences(result, ts, options);
cache?.setParseResult(tsconfigFile, Promise.resolve(result));
}
//@ts-ignore

resolve(resolveSolutionTSConfig(filename, result));
return promise;
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfck/src/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface TSConfckFindAllOptions {
* helper to skip subdirectories when scanning for tsconfig.json
*
* eg ` dir => dir === 'node_modules' || dir === '.git'`
*/ // eslint-disable-next-line no-unused-vars
*/
skip?: (dir: string) => boolean;
/**
* list of config filenames to include, use ["tsconfig.json","jsconfig.json"] if you need both
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfck/tests/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ describe('parse', () => {
new Promise((_, reject) => setTimeout(reject, 500))
]);
expect(results.length).toBe(samples.length);
// eslint-disable-next-line no-unused-vars
} catch (e) {
expect.fail(
`did not process all files, some of these are blocking each other:\n${[...unfinished].join(
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfck/tests/util/copy-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export async function copyFixtures(from, to, filter) {
const dest = path.join('tests', 'temp', to);
try {
await fs.rm(dest, { recursive: true });
// eslint-disable-next-line no-unused-vars
} catch (e) {
// ignore
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfck/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ declare module 'tsconfck' {
* helper to skip subdirectories when scanning for tsconfig.json
*
* eg ` dir => dir === 'node_modules' || dir === '.git'`
*/ // eslint-disable-next-line no-unused-vars
*/
skip?: (dir: string) => boolean;
/**
* list of config filenames to include, use ["tsconfig.json","jsconfig.json"] if you need both
Expand Down
Loading

0 comments on commit b1d2f2a

Please sign in to comment.