Skip to content

Commit

Permalink
chore(ci): use eslint with unstable_ts_config
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Oct 11, 2024
1 parent 7fdb558 commit daa3f1d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 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
4 changes: 2 additions & 2 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 Down Expand Up @@ -76,7 +76,7 @@
"vitest": "^2.0.0"
},
"lint-staged": {
"*.{js,cjs,ts}": "eslint",
"*.{js,cjs,ts}": "eslint --flag unstable_ts_config --flag unstable_config_lookup_from_file",
"*": "prettier --ignore-unknown --write"
},
"dependencies": {
Expand Down
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 daa3f1d

Please sign in to comment.