Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use latest typescript-eslint in examples #235

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ $ npm install
$ npm test

eslint-plugin-markdown/examples/typescript/README.md
6:22 error Dont use `String` as a type. Use string instead @typescript-eslint/ban-types
10:13 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
6:22 error Don't use `String` as a type. Use string instead @typescript-eslint/ban-types
10:13 error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any

✖ 2 problems (1 error, 1 warning)
✖ 2 problems (2 errors, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
```
15 changes: 4 additions & 11 deletions examples/typescript/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

const markdown = require("eslint-plugin-markdown");
const js = require("@eslint/js")
const { FlatCompat } = require("@eslint/eslintrc");
const tseslint = require("typescript-eslint");

const compat = new FlatCompat({
baseDirectory: __dirname
});

module.exports = [
module.exports = tseslint.config(
js.configs.recommended,
...markdown.configs.recommended,
{
Expand All @@ -17,11 +13,8 @@ module.exports = [
sourceType: "commonjs"
}
},
...compat.config({
parser: "@typescript-eslint/parser",
extends: ["plugin:@typescript-eslint/recommended"]
}).map(config => ({
...tseslint.configs.recommended.map(config => ({
...config,
files: ["**/*.ts"]
}))
];
);
6 changes: 2 additions & 4 deletions examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
"test": "eslint ."
},
"devDependencies": {
"@eslint/eslintrc": "^3.0.0",
"@eslint/js": "^8.56.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"eslint": "^8.56.0",
"eslint-plugin-markdown": "file:../..",
"typescript": "^3.9.7"
"typescript": "^5.3.3",
"typescript-eslint": "^7.0.1"
}
}
Loading