Commit graph

16 commits

Author SHA1 Message Date
overlookmotel
dc924892cc test: add trailing line breaks to conformance fixtures (#5541)
Continuation of #5537. Ensure all conformance fixture files have a trailing line break.
2024-09-06 12:55:17 +00:00
overlookmotel
d8b29e752a style: add trailing line breaks to JSON files (#5544)
For consistency with our `.editorconfig`.
2024-09-06 12:50:15 +00:00
overlookmotel
694f032a3d style: add trailing line breaks to package.json files (#5542)
For consistency with our `.editorconfig`.
2024-09-06 12:43:44 +00:00
overlookmotel
670868035b refactor(linter): replace Windows-style line breaks with Unix-style in test fixture (#4768)
I happened to notice that 1 test fixture file had Windows-style CRLF line breaks rather than Unix-style LF. Fixing it for consistency.
2024-08-08 17:33:04 +00:00
Yuji Sugiura
d384f6000a
fix(ci): Remove unused(?) .html file (#4545)
See https://github.com/oxc-project/oxc/actions/workflows/link-check.yml

I don't know why it suddenly started failing, but this file doesn't seem
to be used?
2024-07-30 15:46:48 +08:00
Boshen
313fb839b5
fix(linter/default): ignore unsupported files (e.g. .vue)
relates #3157
2024-05-12 13:33:29 +08:00
Boshen
fde7d65992
fix(linter): handle named export default in import-plugin/named (#3158) 2024-05-04 17:40:56 +08:00
John Daly
5abbb0cada
fix(linter): import/no-cycle ignore type-only imports (#2924)
A fix for the work done in: https://github.com/oxc-project/oxc/pull/2905

The existing code checks if _all_ import entries in a ModuleRecord are
type-only, when determining if the ModuleRecord should be skipped when
checking for cycles. This is incorrect.

To demonstrate the problem: Running the `no-cycles` rule, with
`ignoreTypes` enabled, on the following example code will cause a cycle
to be reported between Module A and Module B

```typescript
// Module A
import type { Bar } from './b';
import { Baz } from './c'

// Module B
import type { Foo } from './a';

// Module C
export const Baz = 'baz';
```

The reason this is happening is because the import to Module C in Module
A is causing the `was_imported_as_type` variable to evaluate to `false`,
since the Module C import is not type-only.

What we actually want to do is skip visiting Module B entirely, by
checking if its import request from Module A is type-only.

This PR fixes the logic so that only the import entries for the next
ModuleRecord are considered when determining `was_imported_as_type`.
2024-04-09 12:38:15 +08:00
John Daly
6de1b77b1b
feat(linter/import): Add ignoreTypes option for the import/no-cycle rule (#2905)
Fixes: https://github.com/oxc-project/oxc/issues/2904

Adds an `ignoreTypes` option for the `import/no-cycle` rule, to ignore
imports that don't have any runtime effect.
2024-04-07 05:07:45 +00:00
Dunqing
c4528974cb
fix(linter/import): false positive for indirect export in namespace (#2862) 2024-03-30 12:55:51 +08:00
Boshen
d41dcc316e
feat(linter): remove all commonjs logic for import plugin (#2537) 2024-02-28 18:13:44 +08:00
Boshen
f64c7e04a3
feat(linter): handle cjs module.exports.foo = bar and exports.foo = bar (#2492) 2024-02-24 23:54:43 +08:00
Boshen
c5f67febc1
feat(linter): add boilerplate for eslint-plugin-import/no_duplicates (#2476) 2024-02-23 18:35:29 +08:00
Valerii Smirnov
c60c31521e
feat(linter): eslint-plugin-import no-named-as-default-member rule (#1988)
- Docs:
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md
- Code:
https://github.com/import-js/eslint-plugin-import/blob/main/src/rules/no-named-as-default-member.js
- Tests:
https://github.com/import-js/eslint-plugin-import/blob/main/tests/src/rules/no-named-as-default-member.js
2024-01-15 11:03:04 +00:00
秦宇航
008b0e650c
feat(linter) eslint-plugin-import: no-amd (#1171) 2023-11-07 20:28:39 +08:00
Boshen
5f7a9c687c chore(linter): add fixtures for import plugin 2023-09-07 22:56:09 +08:00