Skip to content

Commit

Permalink
feat: upgrade codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
junwen-k committed May 27, 2024
1 parent f7840cf commit 717f611
Show file tree
Hide file tree
Showing 18 changed files with 1,840 additions and 1,436 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: pnpm install

- name: Build
run: pnpm run build
run: pnpm build

- name: Test
run: pnpm test
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
node_modules
dist
.vscode
!.vscode/extensions
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"**/*.{js,mjs,ts,tsx,md,mdx}": ["eslint --fix", "prettier --check --write"],
"**/*.{json,yml}": ["prettier --check --write"]
}
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
18 changes: 0 additions & 18 deletions .swcrc

This file was deleted.

8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.experimental.useFlatConfig": true
}
32 changes: 32 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import eslint from '@eslint/js'
import importPlugin from 'eslint-plugin-import'
import prettier from 'eslint-plugin-prettier/recommended'
import tseslint from 'typescript-eslint'

/** @type {import('eslint').Linter.FlatConfig[]} */
export default tseslint.config(
{
ignores: ['node_modules/', 'dist/'],
},
eslint.configs.recommended,
{
plugins: {
['import']: importPlugin,
},
rules: {
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['sibling', 'parent'], 'index', 'unknown'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
},
...tseslint.configs.recommended,
prettier
)
69 changes: 22 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "tailwindcss-radix-ui-primitives",
"description": "A plugin for Tailwind CSS v3.2+ that generates data attribute as well as CSS variable utilities for Radix UI.",
"version": "1.0.0",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
Expand All @@ -11,65 +12,39 @@
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "tsup --watch",
"build": "tsup",
"lint": "eslint --max-warnings 0",
"test": "vitest",
"swcify": "swc ./src/index.ts --out-dir ./dist",
"build": "pnpm run swcify",
"dev": "pnpm run swcify -- --watch",
"prepare": "husky install",
"postbuild": "tsc --emitDeclarationOnly",
"prepublishOnly": "pnpm run build"
"prepare": "husky",
"prepublishOnly": "pnpm build"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=16.0.0"
},
"eslintConfig": {
"env": {
"browser": true,
"es2021": true
},
"extends": "standard-with-typescript",
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {}
},
"prettier": {
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
},
"files": [
"dist"
],
"peerDependencies": {
"tailwindcss": ">=3.2.0"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.88",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"eslint": "^8.50.0",
"husky": "^8.0.3",
"postcss": "^8.4.30",
"prettier": "^2.8.8",
"typescript": "^5.2.2",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.3.0",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.10.0",
"vitest": "^1.6.0"
}
}
Loading

0 comments on commit 717f611

Please sign in to comment.