Skip to content

Commit

Permalink
feat(@pixiv/eslint-config): init
Browse files Browse the repository at this point in the history
  • Loading branch information
yue4u committed Oct 18, 2024
0 parents commit 3ed6f24
Show file tree
Hide file tree
Showing 30 changed files with 6,457 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/metal-trains-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pixiv/eslint-config": patch
---

feat: use @next/eslint-plugin-next directly
7 changes: 7 additions & 0 deletions .changeset/moody-bananas-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@pixiv/eslint-config": patch
---

BREAKING: update eslint-config-react-hooks to v5 https://github.com/facebook/react/releases/tag/eslint-plugin-react-hooks%405.0.0

chore: update deps
5 changes: 5 additions & 0 deletions .changeset/odd-flowers-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pixiv/eslint-config": patch
---

chore: bump deps
15 changes: 15 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"mode": "pre",
"tag": "experimental",
"initialVersions": {
"@pixiv/eslint-config": "0.0.0-experimental-0"
},
"changesets": [
"metal-trains-dress",
"moody-bananas-argue",
"odd-flowers-design",
"short-pugs-return",
"sixty-toys-learn",
"weak-papayas-call"
]
}
5 changes: 5 additions & 0 deletions .changeset/short-pugs-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pixiv/eslint-config": patch
---

lazy init config options
5 changes: 5 additions & 0 deletions .changeset/sixty-toys-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pixiv/eslint-config": patch
---

chore: bump deps
5 changes: 5 additions & 0 deletions .changeset/weak-papayas-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pixiv/eslint-config": patch
---

feat: init release
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Package to npmjs

on:
release:
types: [created]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: publish
run: |
pnpm install
pnpm -r build
pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test

on: push

defaults:
run:
shell: bash

jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: build
run: |
pnpm install
pnpm vitest run
pnpm -r build
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
tmp
dist

.npmrc
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# frontend-config
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "config",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"private": true,
"keywords": [],
"engines": {
"pnpm": ">= 9"
},
"devDependencies": {
"eslint": "9.11.1",
"@babel/preset-typescript": "7.25.7",
"@changesets/cli": "2.27.9",
"@types/node": "22.7.4",
"typescript": "5.6.2",
"vitest": "2.1.2"
},
"resolutions": {
"eslint": "9.11.1"
}
}
1 change: 1 addition & 0 deletions packages/eslint-config/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__snapshots__
38 changes: 38 additions & 0 deletions packages/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# @pixiv/eslint-config

## 0.0.0-experimental.5

### Patch Changes

- BREAKING: update eslint-config-react-hooks to v5, see https://github.com/facebook/react/releases/tag/eslint-plugin-react-hooks%405.0.0
- chore: update deps

## 0.0.0-experimental.4

### Patch Changes

- chore: bump deps

## 0.0.0-experimental.3

### Patch Changes

- feat: use @next/eslint-plugin-next directly

## 0.0.0-experimental.2

### Patch Changes

- chore: bump deps

## 0.0.0-experimental.1

### Patch Changes

- fix: lazy init config options

## 0.0.0-experimental.0

### Patch Changes

- feat: init release
47 changes: 47 additions & 0 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# @pixiv/eslint-config

`pnpm add eslint @pixiv/eslint-config`

eslint.config.mjs

```js
import pixiv from '@pixiv/eslint-config';

export default pixiv.configs.recommended;
```

また

```js
import pixiv from '@pixiv/eslint-config';

export default [
{
ignores: ['tmp', 'vendor', 'public/packs'],
},
...pixiv.configs.recommended,
{
rules: {
'react/self-closing-comp': 'warn',
'import/first': 'warn',
'object-shorthand': 'warn',
curly: 'off',
},
},
];
```

## Goals and non-goals

### Goals

- Reduce the cost for managing eslint related dependencies

### Non-goals

- Managing extremely opinionated lint rules

## Known issues

- This package contains many deps that might not be used
- In some condition it's required to set `public-hoist-pattern[]=eslint-*` in .npmrc
55 changes: 55 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@pixiv/eslint-config",
"version": "0.0.0-experimental.5",
"description": "pixiv's base eslint config",
"author": "pixiv",
"publishConfig": {
"provenance": true
},
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --clean --dts --format esm",
"prepublish": "pnpm build"
},
"exports": {
".": {
"default": "./dist/index.js"
}
},
"repository": {
"type": "git",
"url": "https://github.com/pixiv/frontend-config.git",
"directory": "packages/eslint-config"
},
"files": [
"README.md",
"CHANGELOG.md",
"src",
"dist"
],
"peerDependencies": {
"eslint": "^9.0.0"
},
"dependencies": {
"@eslint/compat": "1.2.0",
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.12.0",
"@next/eslint-plugin-next": "14.2.14",
"@typescript-eslint/eslint-plugin": "8.8.1",
"@typescript-eslint/parser": "8.8.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsx-a11y": "6.10.0",
"eslint-plugin-react": "7.37.1",
"eslint-plugin-react-compiler": "0.0.0-experimental-fa06e2c-20241014",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-storybook": "0.9.0",
"globals": "15.10.0",
"typescript-eslint": "8.8.1"
},
"devDependencies": {
"tsup": "8.3.0"
}
}
9 changes: 9 additions & 0 deletions packages/eslint-config/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3ed6f24

Please sign in to comment.