Skip to content

Commit 06c0690

Browse files
committed
refactor!: de-monorepo
1 parent 09ffbe1 commit 06c0690

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2523
-4577
lines changed

.editorconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
end_of_line = lf
6+
insert_final_newline = true

.eslintrc.json

-3
This file was deleted.

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/ci.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@v2
20+
21+
- name: Set node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: lts/*
25+
26+
- name: Setup
27+
run: npm i -g @antfu/ni
28+
29+
- name: Install
30+
run: nci
31+
32+
- name: Lint
33+
run: nr lint
34+
35+
typecheck:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v3
39+
40+
- name: Install pnpm
41+
uses: pnpm/action-setup@v2
42+
43+
- name: Set node
44+
uses: actions/setup-node@v3
45+
with:
46+
node-version: 18.x
47+
48+
- name: Setup
49+
run: npm i -g @antfu/ni
50+
51+
- name: Install
52+
run: nci
53+
54+
- name: Typecheck
55+
run: nr typecheck

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"source.fixAll.eslint": true,
77
"source.organizeImports": false
88
},
9+
"eslint.experimental.useFlatConfig": true,
910
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "html", "markdown", "json", "jsonc", "yaml"]
1011
}

eslint.config.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { createRequire } from 'node:module'
2+
import stylisticMigrate from '@stylistic/eslint-plugin-migrate'
3+
import sortKeys from 'eslint-plugin-sort-keys'
4+
5+
import { coderwyd } from './dist/index.js'
6+
7+
const require = createRequire(import.meta.url)
8+
require('sucrase/register')
9+
// const { coderwyd } = require('./src/index.ts')
10+
11+
export default coderwyd(
12+
undefined,
13+
{
14+
files: ['**/eslint-config/src/**/*.ts'],
15+
plugins: {
16+
'@stylistic/migrate': stylisticMigrate,
17+
'sort-keys': sortKeys,
18+
},
19+
rules: {
20+
'@stylistic/migrate/rules': 'error',
21+
'sort-keys/sort-keys-fix': 'error',
22+
},
23+
},
24+
)

package.json

+72-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,85 @@
11
{
2-
"name": "@coderwyd/eslint-config-monorepo",
2+
"name": "@coderwyd/eslint-config",
3+
"type": "module",
34
"version": "1.0.10",
45
"private": true,
56
"packageManager": "pnpm@8.7.4",
67
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
78
"license": "MIT",
9+
"homepage": "https://github.com/coderwyd/eslint-config",
10+
"keywords": [
11+
"eslint-config"
12+
],
13+
"exports": {
14+
"import": "./dist/index.js",
15+
"require": "./dist/index.cjs"
16+
},
17+
"main": "./dist/index.js",
18+
"module": "./dist/index.js",
19+
"types": "./dist/index.d.ts",
20+
"files": [
21+
"dist"
22+
],
23+
"publishConfig": {
24+
"access": "public"
25+
},
26+
"engines": {
27+
"node": ">=16.14.0"
28+
},
829
"scripts": {
9-
"lint": "pnpm -r run stub && eslint .",
10-
"test": "pnpm -r run test",
11-
"build": "pnpm -r run build",
12-
"prepare": "pnpm -r run stub",
13-
"release": "bumpp -r && pnpm -r publish --access public",
14-
"up": "taze major -r -I"
30+
"build": "tsup src/index.ts --format esm --clean --dts",
31+
"stub": "tsup src/index.ts --format esm --clean",
32+
"lint": "pnpm run stub && eslint .",
33+
"prepublishOnly": "nr build",
34+
"release": "bumpp && npm publish",
35+
"test": "vitest",
36+
"typecheck": "tsc --noEmit",
37+
"prepare": "simple-git-hooks"
38+
},
39+
"peerDependencies": {
40+
"eslint": ">=8.0.0"
41+
},
42+
"dependencies": {
43+
"@eslint-stylistic/metadata": "0.0.4",
44+
"@eslint/js": "^8.49.0",
45+
"@stylistic/eslint-plugin-js": "0.0.4",
46+
"@stylistic/eslint-plugin-ts": "0.0.4",
47+
"@typescript-eslint/eslint-plugin": "^6.7.2",
48+
"@typescript-eslint/parser": "^6.7.2",
49+
"eslint-define-config": "^1.23.0",
50+
"eslint-plugin-antfu": "^1.0.0-beta.2",
51+
"eslint-plugin-eslint-comments": "^3.2.0",
52+
"eslint-plugin-i": "^2.28.1",
53+
"eslint-plugin-jsdoc": "^46.8.2",
54+
"eslint-plugin-jsonc": "^2.9.0",
55+
"eslint-plugin-markdown": "^3.0.1",
56+
"eslint-plugin-n": "^16.1.0",
57+
"eslint-plugin-no-only-tests": "^3.1.0",
58+
"eslint-plugin-react": "^7.33.2",
59+
"eslint-plugin-react-hooks": "^4.6.0",
60+
"eslint-plugin-unicorn": "^48.0.1",
61+
"eslint-plugin-unused-imports": "^3.0.0",
62+
"eslint-plugin-vue": "^9.17.0",
63+
"eslint-plugin-yml": "^1.9.0",
64+
"globals": "^13.22.0",
65+
"jsonc-eslint-parser": "^2.3.0",
66+
"local-pkg": "^0.4.3",
67+
"vue-eslint-parser": "^9.3.1",
68+
"yaml-eslint-parser": "^1.2.2"
1569
},
1670
"devDependencies": {
17-
"@coderwyd/eslint-config": "workspace:*",
71+
"@stylistic/eslint-plugin-migrate": "0.0.4",
72+
"@types/node": "^20.6.3",
73+
"@types/react": "^18.2.22",
1874
"bumpp": "^9.2.0",
1975
"eslint": "^8.49.0",
20-
"eslint-plugin-coderwyd": "link:./packages/eslint-plugin-coderwyd",
21-
"rimraf": "^5.0.1",
22-
"taze": "^0.11.2",
23-
"typescript": "^5.2.2"
76+
"eslint-plugin-sort-keys": "^2.3.5",
77+
"lint-staged": "^14.0.1",
78+
"react": "^18.2.0",
79+
"simple-git-hooks": "^2.9.0",
80+
"sucrase": "^3.34.0",
81+
"tsup": "^7.2.0",
82+
"typescript": "^5.2.2",
83+
"vitest": "^0.34.5"
2484
}
2585
}

0 commit comments

Comments
 (0)