Skip to content

Commit 70dfaef

Browse files
committed
chore: update lint rule to @ice/spec and add lint-staged
1 parent 9f732e5 commit 70dfaef

File tree

10 files changed

+2237
-2688
lines changed

10 files changed

+2237
-2688
lines changed

.eslintignore

Lines changed: 0 additions & 38 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lint-staged

.prettierrc.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierrc.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { getConfig } from '@ice/spec/prettier';
2+
3+
export default getConfig();

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ A fast builder for React components、Node modules and web libraries.
1818
- **Modern Mode**:Outputs es2017 JavaScript specially designed to work in all modern browsers.
1919
- **Doc Preview**:Enhanced doc preview, powered by [Docusaurus](https://docusaurus.io/).
2020

21-
2221
## Quick Start
2322

2423
```bash
@@ -41,6 +40,12 @@ For complete usages, please dive into the [docs](https://pkg.ice.work/).
4140

4241
Please see our [CONTRIBUTING.md](/.github/CONTRIBUTING.md)
4342

43+
## Deprecated Packages
44+
45+
Those packages are deprecated and removed in v2 project. You can switch to v1 branch to see the packages.
46+
47+
- `@ice/pkg-plugin-rax-component`
48+
4449
## License
4550

4651
[MIT](https://oss.ninja/mit/developit/)

eslint.config.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import eslint from '@ice/spec/eslint';
2+
3+
export default [
4+
...eslint.getConfig({
5+
preset: 'pkg',
6+
}),
7+
{
8+
files: ['**/{demo,__tests__}/**/*.{ts,tsx}', 'scripts/**/*.{ts,js}'],
9+
rules: {
10+
// 测试文件允许使用 console
11+
'no-console': 'off',
12+
},
13+
},
14+
{
15+
ignores: [
16+
'**/esm/',
17+
'**/es2017',
18+
'**/cjs/',
19+
'**/.icecream',
20+
'**/asn/'
21+
],
22+
},
23+
];

lint-staged.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
"*.{js,jsx,less,md,json}": [
3+
"prettier --write"
4+
],
5+
"*.{ts,tsx}": [
6+
"eslint --fix"
7+
]
8+
}

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,35 @@
1111
"clean": "rm -rf packages/*/lib",
1212
"test": "vitest run",
1313
"coverage": "vitest run --coverage",
14-
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx,.mts,.mjs ./",
14+
"lint": "eslint --cache",
1515
"lint:fix": "pnpm run lint --fix",
1616
"build:doc": "cd website && pnpm run build",
1717
"changeset": "changeset",
1818
"install:frozen": "pnpm install --frozen-lockfile false",
1919
"version": "changeset version && pnpm install:frozen",
2020
"release": "changeset publish",
2121
"release:beta": "changeset pre enter beta && pnpm run version && pnpm build && pnpm release && changeset pre exit",
22-
"release:snapshot": "changeset version --snapshot canary && pnpm install:frozen && pnpm build && pnpm release --tag canary --no-git-tag --snapshot"
22+
"release:snapshot": "changeset version --snapshot canary && pnpm install:frozen && pnpm build && pnpm release --tag canary --no-git-tag --snapshot",
23+
"prepare": "husky"
2324
},
2425
"author": "ICE Team",
2526
"devDependencies": {
2627
"@changesets/cli": "^2.26.0",
2728
"@commitlint/cli": "^15.0.0",
28-
"@iceworks/spec": "^1.6.0",
29+
"@ice/spec": "2.0.0-beta.3",
2930
"@types/fs-extra": "^9.0.13",
3031
"@types/node": "^17.0.45",
3132
"@vitest/coverage-c8": "catalog:",
3233
"axios": "^0.23.0",
3334
"c8": "^7.11.3",
34-
"eslint": "^8.19.0",
35+
"eslint": "^9.24.0",
3536
"fs-extra": "^10.1.0",
37+
"husky": "^9.1.7",
3638
"ice-npm-utils": "workspace:^3.0.2",
39+
"lint-staged": "^15.5.1",
3740
"npm-run-all": "^4.1.5",
41+
"prettier": "^3.5.3",
3842
"rimraf": "^3.0.2",
39-
"stylelint": "^13.13.1",
4043
"ts-node": "^10.8.2",
4144
"typescript": "catalog:",
4245
"vitest": "catalog:"

0 commit comments

Comments
 (0)