Skip to content

Commit

Permalink
fix(stylelint): resolve optionator from eslint dir (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework authored Jul 2, 2024
1 parent 909182e commit 80ca69c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/stupid-years-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vite-plugin-checker': patch
---

Resolve optionaltor from ESLint path, do not requires to install optionator anymore
1 change: 0 additions & 1 deletion packages/vite-plugin-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
"esbuild": "^0.14.27",
"meow": "^9.0.0",
"npm-run-all": "^4.1.5",
"optionator": "^0.9.1",
"stylelint": "^14.0.0",
"tsup": "^6.7.0",
"typescript": "^5.0.4",
Expand Down
13 changes: 10 additions & 3 deletions packages/vite-plugin-checker/src/checkers/eslint/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
*/

'use strict'
// import { createRequire } from 'module'

import { createRequire } from 'node:module'
const _require = createRequire(import.meta.url)
import { dirname } from 'node:path'

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

// @ts-ignore
import optionator from 'optionator'
const eslintDir = dirname(_require.resolve('eslint/package.json'))
const optionatorPath = _require.resolve('optionator', {
paths: [eslintDir],
})
const optionator = _require(optionatorPath)

//------------------------------------------------------------------------------
// Typedefs
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.

0 comments on commit 80ca69c

Please sign in to comment.