Skip to content

Commit

Permalink
chore: update dev script
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 10, 2024
1 parent 2fe73a4 commit 2263538
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 138 deletions.
44 changes: 4 additions & 40 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,6 @@
// @ts-check
import styleMigrate from '@stylistic/eslint-plugin-migrate'
import JITI from 'jiti'
import { bundleRequire } from 'bundle-require'

const jiti = JITI(import.meta.url)
/**
* @type {import('./src').default}
*/
const antfu = jiti('./src').default

export default antfu(
{
vue: true,
react: true,
solid: true,
svelte: true,
astro: true,
typescript: true,
formatters: true,
},
{
ignores: [
'fixtures',
'_fixtures',
],
},
{
files: ['src/**/*.ts'],
rules: {
'perfectionist/sort-objects': 'error',
},
},
{
files: ['src/configs/*.ts'],
plugins: {
'style-migrate': styleMigrate,
},
rules: {
'style-migrate/migrate': ['error', { namespaceTo: 'style' }],
},
},
)
export default bundleRequire({
filepath: './eslint.config.ts',
}).then(r => r.mod.default)
36 changes: 36 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// @ts-expect-error missing types
import styleMigrate from '@stylistic/eslint-plugin-migrate'
import { antfu } from './src'

export default antfu(
{
vue: true,
react: true,
solid: true,
svelte: true,
astro: true,
typescript: true,
formatters: true,
},
{
ignores: [
'fixtures',
'_fixtures',
],
},
{
files: ['src/**/*.ts'],
rules: {
'perfectionist/sort-objects': 'error',
},
},
{
files: ['src/configs/*.ts'],
plugins: {
'style-migrate': styleMigrate,
},
rules: {
'style-migrate/migrate': ['error', { namespaceTo: 'style' }],
},
},
)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"scripts": {
"build": "nr typegen && tsup --format esm,cjs --clean --dts",
"stub": "tsup --format esm",
"dev": "tsup --format esm,cjs --watch & npx @eslint/config-inspector",
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
"watch": "tsup --format esm,cjs --watch",
"lint": "eslint .",
Expand Down Expand Up @@ -140,6 +140,7 @@
"@unocss/eslint-plugin": "^0.59.0",
"astro-eslint-parser": "^0.17.0",
"bumpp": "^9.4.0",
"bundle-require": "^4.0.2",
"eslint": "^9.0.0",
"eslint-plugin-astro": "^0.34.0",
"eslint-plugin-format": "^0.1.0",
Expand Down
Loading

0 comments on commit 2263538

Please sign in to comment.