Skip to content

Commit 74b179e

Browse files
committed
feat: init
0 parents  commit 74b179e

20 files changed

+4868
-0
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [antfu]

.github/workflows/ci.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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: lts/*
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
56+
57+
test:
58+
runs-on: ${{ matrix.os }}
59+
60+
strategy:
61+
matrix:
62+
node: [lts/*]
63+
os: [ubuntu-latest, windows-latest, macos-latest]
64+
fail-fast: false
65+
66+
steps:
67+
- uses: actions/checkout@v3
68+
69+
- name: Install pnpm
70+
uses: pnpm/action-setup@v2
71+
72+
- name: Set node ${{ matrix.node }}
73+
uses: actions/setup-node@v3
74+
with:
75+
node-version: ${{ matrix.node }}
76+
77+
- name: Setup
78+
run: npm i -g @antfu/ni
79+
80+
- name: Install
81+
run: nci
82+
83+
- name: Build
84+
run: nr build
85+
86+
- name: Test
87+
run: nr test

.github/workflows/release.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v2
21+
22+
- name: Set node
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: lts/*
26+
27+
- run: npx changelogithub
28+
env:
29+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.cache
2+
.DS_Store
3+
.idea
4+
*.log
5+
*.tgz
6+
coverage
7+
dist
8+
lib-cov
9+
logs
10+
node_modules
11+
temp

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore-workspace-root-check=true

.vscode/settings.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
// Enable the ESlint flat config support
3+
"eslint.experimental.useFlatConfig": true,
4+
5+
// Disable the default formatter, use eslint instead
6+
"prettier.enable": false,
7+
"editor.formatOnSave": false,
8+
9+
// Auto fix
10+
"editor.codeActionsOnSave": {
11+
"source.fixAll": "explicit",
12+
"source.organizeImports": "never"
13+
},
14+
15+
// Silent the stylistic rules in you IDE, but still auto fix them
16+
"eslint.rules.customizations": [
17+
{ "rule": "style/*", "severity": "off" },
18+
{ "rule": "*-indent", "severity": "off" },
19+
{ "rule": "*-spacing", "severity": "off" },
20+
{ "rule": "*-spaces", "severity": "off" },
21+
{ "rule": "*-order", "severity": "off" },
22+
{ "rule": "*-dangle", "severity": "off" },
23+
{ "rule": "*-newline", "severity": "off" },
24+
{ "rule": "*quotes", "severity": "off" },
25+
{ "rule": "*semi", "severity": "off" }
26+
],
27+
28+
// Enable eslint for all supported languages
29+
"eslint.validate": [
30+
"javascript",
31+
"javascriptreact",
32+
"typescript",
33+
"typescriptreact",
34+
"vue",
35+
"html",
36+
"markdown",
37+
"json",
38+
"jsonc",
39+
"yaml"
40+
]
41+
}

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please refer to https://github.com/antfu/contribute

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Anthony Fu <https://github.com/antfu>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# eslint-plugin-format
2+
3+
[![npm version][npm-version-src]][npm-version-href]
4+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
5+
[![bundle][bundle-src]][bundle-href]
6+
[![JSDocs][jsdocs-src]][jsdocs-href]
7+
[![License][license-src]][license-href]
8+
9+
Plain text formatters integration for ESLint.
10+
11+
## Sponsors
12+
13+
<p align="center">
14+
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
15+
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
16+
</a>
17+
</p>
18+
19+
## License
20+
21+
[MIT](./LICENSE) License © 2023-PRESENT [Anthony Fu](https://github.com/antfu)
22+
23+
24+
<!-- Badges -->
25+
26+
[npm-version-src]: https://img.shields.io/npm/v/eslint-plugin-format?style=flat&colorA=080f12&colorB=1fa669
27+
[npm-version-href]: https://npmjs.com/package/eslint-plugin-format
28+
[npm-downloads-src]: https://img.shields.io/npm/dm/eslint-plugin-format?style=flat&colorA=080f12&colorB=1fa669
29+
[npm-downloads-href]: https://npmjs.com/package/eslint-plugin-format
30+
[bundle-src]: https://img.shields.io/bundlephobia/minzip/eslint-plugin-format?style=flat&colorA=080f12&colorB=1fa669&label=minzip
31+
[bundle-href]: https://bundlephobia.com/result?p=eslint-plugin-format
32+
[license-src]: https://img.shields.io/github/license/antfu/eslint-plugin-format.svg?style=flat&colorA=080f12&colorB=1fa669
33+
[license-href]: https://github.com/antfu/eslint-plugin-format/blob/main/LICENSE
34+
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
35+
[jsdocs-href]: https://www.jsdocs.io/package/eslint-plugin-format

build.config.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: [
5+
'src/index',
6+
],
7+
declaration: true,
8+
clean: true,
9+
rollup: {
10+
emitCJS: true,
11+
},
12+
})

eslint.config.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @ts-check
2+
import antfu from '@antfu/eslint-config'
3+
import formatters from 'eslint-plugin-format'
4+
5+
export default antfu(
6+
{},
7+
{
8+
files: ['**/*.css'],
9+
languageOptions: {
10+
parser: formatters.parserPlain,
11+
},
12+
plugins: {
13+
formatters,
14+
},
15+
rules: {
16+
'formatters/prettier': ['error', { parser: 'css' }],
17+
},
18+
},
19+
)

package.json

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"name": "eslint-plugin-format",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"packageManager": "[email protected]",
6+
"description": "_description_",
7+
"author": "Anthony Fu <[email protected]>",
8+
"license": "MIT",
9+
"funding": "https://github.com/sponsors/antfu",
10+
"homepage": "https://github.com/antfu/eslint-plugin-format#readme",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/antfu/eslint-plugin-format.git"
14+
},
15+
"bugs": "https://github.com/antfu/eslint-plugin-format/issues",
16+
"keywords": [],
17+
"sideEffects": false,
18+
"exports": {
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"import": "./dist/index.mjs",
22+
"require": "./dist/index.cjs"
23+
}
24+
},
25+
"main": "./dist/index.mjs",
26+
"module": "./dist/index.mjs",
27+
"types": "./dist/index.d.ts",
28+
"typesVersions": {
29+
"*": {
30+
"*": [
31+
"./dist/*",
32+
"./dist/index.d.ts"
33+
]
34+
}
35+
},
36+
"files": [
37+
"dist"
38+
],
39+
"scripts": {
40+
"build": "unbuild",
41+
"dev": "unbuild --stub",
42+
"lint": "nr build && eslint .",
43+
"prepublishOnly": "nr build",
44+
"release": "bumpp && npm publish",
45+
"start": "esno src/index.ts",
46+
"test": "vitest",
47+
"typecheck": "tsc --noEmit",
48+
"prepare": "simple-git-hooks"
49+
},
50+
"peerDependencies": {
51+
"eslint": "^8.40.0"
52+
},
53+
"dependencies": {
54+
"eslint-formatting-reporter": "^0.0.0",
55+
"eslint-parser-plain": "^0.1.0",
56+
"prettier": "^3.1.0",
57+
"synckit": "^0.8.6"
58+
},
59+
"devDependencies": {
60+
"@antfu/eslint-config": "^2.2.2",
61+
"@antfu/ni": "^0.21.12",
62+
"@antfu/utils": "^0.7.6",
63+
"@types/eslint": "^8.44.8",
64+
"@types/node": "^20.10.3",
65+
"bumpp": "^9.2.0",
66+
"eslint": "^8.55.0",
67+
"eslint-plugin-format": "workspace:*",
68+
"esno": "^4.0.0",
69+
"lint-staged": "^15.2.0",
70+
"pnpm": "^8.11.0",
71+
"rimraf": "^5.0.5",
72+
"simple-git-hooks": "^2.9.0",
73+
"typescript": "^5.3.2",
74+
"unbuild": "^2.0.0",
75+
"vite": "^5.0.5",
76+
"vitest": "^1.0.0-beta.6"
77+
},
78+
"simple-git-hooks": {
79+
"pre-commit": "pnpm lint-staged"
80+
},
81+
"lint-staged": {
82+
"*": "eslint --fix"
83+
}
84+
}

0 commit comments

Comments
 (0)