Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add eslint 9 config support #762

Merged
merged 18 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix type errors
  • Loading branch information
aklinker1 committed Jun 30, 2024
commit 624626854dc3315942d5ee4ed37616c961d0afd4
1 change: 0 additions & 1 deletion packages/wxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
"devDependencies": {
"@aklinker1/check": "^1.3.1",
"@faker-js/faker": "^8.4.1",
"@types/eslint": "^8.56.10",
"@types/fs-extra": "^11.0.4",
"@types/lodash.merge": "^4.6.9",
"@types/natural-compare": "^1.4.3",
Expand Down
1 change: 0 additions & 1 deletion packages/wxt/src/core/utils/building/generate-wxt-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import path from 'node:path';
import { Message, parseI18nMessages } from '~/core/utils/i18n';
import { writeFileIfDifferent, getPublicFiles } from '~/core/utils/fs';
import { wxt } from '../../wxt';
import { getEslintVersion } from '~/core/utils/eslint';

/**
* Generate and write all the files inside the `InternalConfig.typesDir` directory.
Expand Down
9 changes: 4 additions & 5 deletions packages/wxt/src/core/utils/building/resolve-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
WxtModule,
WxtModuleWithMetadata,
ResolvedEslintrc,
WxtUnimportOptions,
Eslintrc,
} from '~/types';
import path from 'node:path';
Expand Down Expand Up @@ -341,10 +340,10 @@ async function getUnimportEslintOptions(
case 'auto':
const version = await getEslintVersion();
let major = parseInt(version[0]);
if (major < 8) major = 8;
else if (major > 9) major = 9;

eslintEnabled = isNaN(major) ? 8 : major;
if (major <= 8) eslintEnabled = 8;
else if (major >= 9) eslintEnabled = 9;
// NaN
else eslintEnabled = 8;
break;
case true:
eslintEnabled = 8;
Expand Down
2 changes: 1 addition & 1 deletion packages/wxt/src/core/utils/testing/fake-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export const fakeResolvedConfig = fakeObjectCreator<ResolvedConfig>(() => {
fsCache: mock<FsCache>(),
imports: {
eslintrc: {
enabled: faker.datatype.boolean(),
enabled: faker.helpers.arrayElement([false, 8, 9]),
filePath: fakeFile(),
globalsPropValue: faker.helpers.arrayElement([
true,
Expand Down
14 changes: 0 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.