Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add linting #7

Merged
merged 5 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: CI
on:
push:
branches:
- '**'
- '!main'
- "**"
- "!main"
pull_request:
branches:
- '**'
- '!main'
- "**"
- "!main"

jobs:
test:
Expand All @@ -22,4 +22,6 @@ jobs:
node-version: lts/*
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm test
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"arrowParens": "always",
"printWidth": 80,
"semi": false,
"singleQuote": false,
"trailingComma": "all",
"useTabs": true,
"overrides": [{ "files": "**/package.json", "options": { "useTabs": false } }]
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ bun add lexirank
## Usage

```js
import { LexiRank, AsciiPrintableCharSet } from 'lexirank';
import { LexiRank, AsciiPrintableCharSet } from "lexirank"

const lexirank = new LexiRank(new AsciiPrintableCharSet());
const lexirank = new LexiRank(new AsciiPrintableCharSet())

const mid = lexirank.mid(); // "O"
const beforeMid = lexirank.before(mid); // "8"
const afterMid = lexirank.after(mid); // "f"
const between = lexirank.between('A', 'C'); // "B"
const mid = lexirank.mid() // "O"
const beforeMid = lexirank.before(mid) // "8"
const afterMid = lexirank.after(mid) // "f"
const between = lexirank.between("A", "C") // "B"
```

## License
Expand Down
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import js from "@eslint/js"

/** @type {import('eslint').Linter.Config[]} */
export default [js.configs.recommended]
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@
"test:watch": "vitest",
"build": "tsc",
"prepare": "pnpm build",
"release": "changeset publish"
"release": "changeset publish",
"format": "prettier --write .",
"lint": "eslint && prettier --check ."
},
"devDependencies": {
"@changesets/cli": "^2.27.11",
"@eslint/js": "^9.17.0",
"eslint": "^9.17.0",
"prettier": "^3.4.2",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
},
Expand Down
Loading
Loading