Open hyoban opened 1 week ago
Another example:
Given the following file:
// test.ts
import { onMount } from 'svelte';
import { readable, type Readable } from 'svelte/store';
export function main() {
console.log(onMount);
console.log(readable);
let variable: Readable<number> | number = 1;
variable = 2;
console.log(variable);
}
and the following config:
import * as importPlugin from 'eslint-plugin-import-x';
import tseslint from 'typescript-eslint';
const config = [
{
files: ['test.ts'],
plugins: { import: importPlugin },
settings: { 'import-x/resolver': { typescript: true, node: true } },
rules: {
'import/no-duplicates': ['warn', { 'prefer-inline': true }]
}
}
];
export default tseslint.config(...tseslint.configs.recommended, ...config);
Running eslint --fix test.ts
will produce the follow incorrect file:
import { onMount , readable, type Readable } from 'svelte';
...
Reproduction:
npm run lint
test.ts