Skip to content

Commit

Permalink
chore(ci): use eslint with unstable_ts_config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Oct 11, 2024
1 parent 7fdb558 commit 54073cb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
run: npx oxlint

- name: Run eslint
run: npx eslint
run: npx eslint --flag unstable_ts_config
2 changes: 1 addition & 1 deletion eslint.config.js → eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import oxlint from './lib/index.cjs';
import oxlint from './src/index.js';
import unicorn from 'eslint-plugin-unicorn';
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"generate": "node --import @oxc-node/core/register ./scripts/generate.ts && pnpm format",
"clone": "node --import @oxc-node/core/register ./scripts/sparse-clone.ts",
"build": "vite build",
"lint": "npx oxlint && npx eslint",
"lint": "npx oxlint && npx eslint --flag unstable_ts_config",
"format": "npx prettier --write .",
"release": "bumpp package.json",
"prepare": "husky",
Expand All @@ -52,7 +52,6 @@
"rules"
],
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0",
"@oxc-node/core": "^0.0.15",
"@types/node": "^22.0.0",
Expand All @@ -76,7 +75,7 @@
"vitest": "^2.0.0"
},
"lint-staged": {
"*.{js,cjs,ts}": "eslint",
"*.{js,cjs,ts}": "eslint --flag unstable_ts_config",
"*": "prettier --ignore-unknown --write"
},
"dependencies": {
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

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

32 changes: 13 additions & 19 deletions src/__snapshots__/rules-by-scope.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"@typescript-eslint/no-array-constructor": [
2,
0,
],
"@typescript-eslint/no-confusing-non-null-assertion": [
0,
Expand Down Expand Up @@ -156,7 +156,7 @@ exports[`contains all the oxlint rules 1`] = `
2,
],
"@typescript-eslint/no-unused-vars": [
2,
0,
],
"@typescript-eslint/no-useless-constructor": [
0,
Expand All @@ -168,7 +168,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"@typescript-eslint/no-wrapper-object-types": [
2,
0,
],
"@typescript-eslint/object-curly-spacing": [
0,
Expand All @@ -189,7 +189,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"@typescript-eslint/prefer-namespace-keyword": [
2,
0,
],
"@typescript-eslint/prefer-ts-expect-error": [
0,
Expand Down Expand Up @@ -918,7 +918,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"no-invalid-regexp": [
2,
0,
],
"no-irregular-whitespace": [
0,
Expand Down Expand Up @@ -966,9 +966,6 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"no-new-native-nonconstructor": [
2,
],
"no-new-symbol": [
0,
],
"no-new-wrappers": [
Expand Down Expand Up @@ -1007,9 +1004,6 @@ exports[`contains all the oxlint rules 1`] = `
"no-return-assign": [
0,
],
"no-return-await": [
0,
],
"no-script-url": [
0,
],
Expand Down Expand Up @@ -1059,7 +1053,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"no-unreachable": [
2,
0,
],
"no-unsafe-finally": [
0,
Expand Down Expand Up @@ -1434,7 +1428,7 @@ exports[`contains all the oxlint rules 1`] = `
2,
],
"unicorn/consistent-function-scoping": [
2,
0,
],
"unicorn/custom-error-definition": [
0,
Expand Down Expand Up @@ -1467,7 +1461,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"unicorn/no-anonymous-default-export": [
2,
0,
],
"unicorn/no-array-callback-reference": [
2,
Expand Down Expand Up @@ -1518,19 +1512,19 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"unicorn/no-length-as-slice-end": [
2,
0,
],
"unicorn/no-lonely-if": [
0,
],
"unicorn/no-magic-array-flat-depth": [
2,
0,
],
"unicorn/no-negated-condition": [
0,
],
"unicorn/no-negation-in-equality-check": [
2,
0,
],
"unicorn/no-nested-ternary": [
0,
Expand Down Expand Up @@ -1596,7 +1590,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"unicorn/no-useless-undefined": [
2,
0,
],
"unicorn/no-zero-fractions": [
0,
Expand Down Expand Up @@ -1743,7 +1737,7 @@ exports[`contains all the oxlint rules 1`] = `
0,
],
"unicorn/prefer-structured-clone": [
2,
0,
],
"unicorn/prefer-switch": [
2,
Expand Down
1 change: 1 addition & 0 deletions test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import oxlint from '../src/index.js';

export const ESLintTestConfig: ESLint.Options = {
baseConfig: oxlint.configs['flat/all'],
flags: ['unstable_ts_config'],
};

0 comments on commit 54073cb

Please sign in to comment.