File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
import eslintPluginAstro from 'eslint-plugin-astro' ;
2
2
import tseslint from "typescript-eslint" ;
3
-
3
+ /** @type { import("@typescript-eslint/utils").TSESLint.FlatConfig.ConfigArray } */
4
4
export default [
5
- ...tseslint . configs . recommended ,
5
+ { ignores : [ "*.config.*" ] } ,
6
+ ...tseslint . configs . strictTypeChecked ,
7
+ ...tseslint . configs . stylisticTypeChecked ,
6
8
// First issue, eslintPluginAstro MUST be defined after, since it overrides the typescript parser
7
- ...eslintPluginAstro . configs [ ' flat/all' ] ,
9
+ ...eslintPluginAstro . configs [ " flat/all" ] ,
8
10
{
9
11
rules : {
10
12
'@typescript-eslint/await-thenable' : "error" ,
Original file line number Diff line number Diff line change @@ -24,8 +24,12 @@ const b = 0;
24
24
const c = null!;
25
25
const d: any = 1;
26
26
27
- const element = document.getElementById("my-root")!;
28
- element.offsetLeft += 4;
27
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
+ const element = document.getElementById("myroot")!;
29
+ // no error
30
+ console.log(element.offsetLeft + 4);
31
+ // error Invalid operand for a '+' operation. Operands must each be a number or string. Got `any` @typescript-eslint/restrict-plus-operands
32
+ console.log(element.offsetLeft += 4);
29
33
console.log(d);
30
34
console.log("c");
31
35
const container = document.querySelector(".container")!;
You can’t perform that action at this time.
0 commit comments