Skip to content
Open
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
25 changes: 25 additions & 0 deletions .eslint-doc-generatorrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* eslint-disable unicorn/prevent-abbreviations */
/** @type {import('eslint-doc-generator').GenerateOptions} */
const config = {
// configEmoji: [['recommended', '✅']],
// ignoreConfig: ['all', 'flat/all', 'flat/recommended'],
ignoreDeprecatedRules: true,
// ruleDocNotices: [],
// ruleDocSectionExclude: [],
// ruleDocSectionInclude: [],
ruleDocTitleFormat: "desc",
ruleListColumns: [
"name",
"description",
"configsError",
"configsWarn",
"fixable",
"hasSuggestions",
"requiresTypeChecking",
],
// ruleListSplit: [],
// urlConfigs: 'https://github.com/...#preset-configs-eslintconfigjs',
};

// eslint-disable-next-line no-undef
module.exports = config;
21 changes: 11 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
name: Bug report
about: Create a report to help us improve
title: "[BUG] "
labels: 'bug'
assignees: ''

labels: "bug"
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'

1. Go to '…'
2. Click on '…'
3. Scroll down to '…'
4. See error

**Expected behavior**
Expand All @@ -24,10 +24,11 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. macOS, windows 10]
- Softwares + version used:
- [e.g. VSCode 1.54.3]
- [... Terminal 2.9.5, npm 6.14.5, node v14.5.0]

- OS: [e.g. macOS, windows 10]
- Softwares + version used:
- [e.g. VSCode 1.54.3]
- [… Terminal 2.9.5, npm 6.14.5, node v14.5.0]

**Additional context**
Add any other context about the problem here.
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
name: Feature request
about: Suggest an idea for this project
title: "[Feature request] "
labels: 'enhancement'
assignees: ''

labels: "enhancement"
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the problem is. Ex. I'm always frustrated when []

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
Expand Down
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Please also list any relevant details for your test configuration
**Test Configuration**:

- OS + version: e.g. macOS Mojave
- NPM version: ...
- Node version: ...
- NPM version:
- Node version:

## Checklist:

Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/build.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
- push

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Run the tests
run: |
node --version
pnpm --version
pnpm run lint
pnpm run test
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
.pnp.js

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
build
dist


# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
.DS_Store
*.pem
.idea
/lib
*.tsbuildinfo
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.0
v20.10.0
10 changes: 8 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
"editor.formatOnSave": true,
"files.associations": {
"*.css": "tailwindcss"
}
}
66 changes: 63 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,70 @@ email, or any other method with the owners of this repository before making a ch

Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.

## Development
## Getting started with development

You can use [Corepack](https://nodejs.org/api/corepack.html) to ensure you're using the same package
manager. Run `corepack enabled` before running `npm install`.
I worked on this repo using `pnpm` but it should work with other package manager.

### Install

`pnpm i`

### Build

`pnpm build`

### Test

`pnpm test`

or

`pnpm test:jest`

#### `jest` or `vitest`

Tests were setup to work with `jest` and `vitest` both comes with pros and cons…

I would recommend Vitest but I also added Jest in case you want it.

| Jest | Vitest |
| :----------------------- | :--------------------------------------------- |
| Based on `commonjs` | Based on `ESM` |
| ✅ Mocking | ✅ Mocking |
| ✅ Snapshots | ✅ Snapshots |
| ✅ Parallel testing | ✅ Parallel testing |
| ✅ Fast | ✅ Often faster |
| - | ✅ Support benches |
| ❌ Require `ts-jest` lib | ❌ Requires `setupFile` and `vitest.config.ts` |

NB: In order to use, the [`RuleTester`](https://typescript-eslint.io/packages/rule-tester) from `@typescript-eslint/rule-tester`, we must:

- Have a `tsconfig.json` with:
```
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext"
}
}
```
More info can be found on [`v6`: Cannot find module `@typescript-eslint/*` or its corresponding type declarations](https://github.com/typescript-eslint/typescript-eslint/issues/7284).
> You can use `bundler`, `node16`, or `nodenext` for `moduleResolution`.
- Use `eslint` with `v8`, [`typescript-eslint` does not support `v9` yet](https://github.com/typescript-eslint/typescript-eslint/issues/8211)

### Docs

`pnpm docs:init` will create new files for each rule if necessary.

`pnpm docs:update` will update existing files and the rules list.

You can see an example of generated documentation in the next section.

## Additional resources

See [`eslint-plugin-example-typed-linting`](https://github.com/typescript-eslint/examples/tree/main/packages/eslint-plugin-example-typed-linting) for an example plugin that supports typed linting.

Another example of eslint-plugin using `typescript-eslint` is [`eslint-plugin-vitest`](https://github.com/vitest-dev/eslint-plugin-vitest)…

## Pull Request Process

Expand Down
Loading