Skip to content

Commit

Permalink
test: use latest typescript-eslint in examples (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored Feb 15, 2024
1 parent 4e2e160 commit 313959b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
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"
}
}

0 comments on commit 313959b

Please sign in to comment.