Skip to content

Commit 00cffac

Browse files
authored
fix(oxlint): do not add typescript plugin to js project (#914)
1 parent 3a0be44 commit 00cffac

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,11 @@ async function init() {
541541

542542
// These configs only disable rules, so they should be applied last.
543543
render('linting/oxlint')
544+
// Provide data for the oxlintrc.json template
545+
callbacks.push(async (dataStore) => {
546+
const oxlintrcPath = path.resolve(root, '.oxlintrc.json')
547+
dataStore[oxlintrcPath] = { needsTypeScript }
548+
})
544549
if (needsPrettier || needsOxfmt) {
545550
render('linting/formatter')
546551
}

template/linting/oxlint/_oxlintrc.json renamed to template/linting/oxlint/_oxlintrc.json.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3-
"plugins": ["eslint", "typescript", "unicorn", "oxc", "vue"],
3+
"plugins": ["eslint"<%_ if (needsTypeScript) { _%>, "typescript"<%_ } _%>, "unicorn", "oxc", "vue"],
44
"env": {
55
"browser": true
66
},

0 commit comments

Comments
 (0)