Skip to content

Commit 83d5dbc

Browse files
Release @tanstack/eslint-config (#221)
* Release @tanstack/eslint-config * Fix missing eslint
1 parent 03e451a commit 83d5dbc

File tree

20 files changed

+203
-216
lines changed

20 files changed

+203
-216
lines changed

.changeset/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.changeset/long-apples-fix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@tanstack/typedoc-config': minor
33
---
44

5-
feat: release @tanstack/typedoc-config
5+
Release @tanstack/typedoc-config

.changeset/thin-carrots-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/eslint-config': minor
3+
---
4+
5+
Release @tanstack/eslint-config

.github/workflows/ci.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
name: ci
1+
name: release
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
tag:
7-
description: override release tag
8-
required: false
94
push:
105
branches: [main, alpha, beta]
116

@@ -22,8 +17,8 @@ permissions:
2217
pull-requests: write
2318

2419
jobs:
25-
test-and-publish:
26-
name: Test & Publish
20+
release:
21+
name: Release
2722
if: github.repository_owner == 'TanStack'
2823
runs-on: ubuntu-latest
2924
steps:

CONTRIBUTING.md

Lines changed: 3 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -108,81 +108,9 @@ You can use Gitpod (An Online Open Source VS Code like IDE which is free for Ope
108108

109109
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/config)
110110

111-
## Commit message conventions
111+
## Changesets
112112

113-
`TanStack/config` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).
114-
115-
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**.
116-
117-
### Commit Message Format
118-
119-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
120-
format that includes a **type**, a **scope** and a **subject**:
121-
122-
```
123-
<type>(<scope>): <subject>
124-
<BLANK LINE>
125-
<body>
126-
<BLANK LINE>
127-
<footer>
128-
```
129-
130-
The **header** is mandatory and the **scope** of the header is optional.
131-
132-
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
133-
134-
### Type
135-
136-
Must be one of the following:
137-
138-
- **feat**: A new feature
139-
- **fix**: A bug fix
140-
- **docs**: Documentation only changes
141-
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
142-
semi-colons, etc)
143-
- **refactor**: A code change that neither fixes a bug nor adds a feature
144-
- **perf**: A code change that improves performance
145-
- **test**: Adding missing or correcting existing tests
146-
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
147-
generation
148-
149-
### Scope
150-
151-
The scope could be anything specifying place of the commit change. For example `useForm`, `useMutation` etc...
152-
153-
You can use `*` when the change affects more than a single scope.
154-
155-
### Subject
156-
157-
The subject contains succinct description of the change:
158-
159-
- use the imperative, present tense: "change" not "changed" nor "changes"
160-
- don't capitalize first letter
161-
- no dot (.) at the end
162-
163-
### Body
164-
165-
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
166-
167-
### Footer
168-
169-
The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).
170-
171-
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
172-
173-
### Example
174-
175-
Here is an example of the release type that will be done based on a commit messages:
176-
177-
| Commit message | Release type |
178-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
179-
| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
180-
| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
181-
| `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |
182-
183-
### Revert
184-
185-
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
113+
This repo uses [Changesets](https://github.com/changesets/changesets) to automate releases. If your PR should release a new package version (patch, minor, or major), please run run `pnpm changeset` and commit the file. If needed, changeset descriptions can be more descriptive, and will be included in the changelog. If your PR affects docs, examples, styles, etc., you probably don't need to generate a changeset.
186114

187115
## Pull requests
188116

@@ -192,4 +120,4 @@ Use an appropriate commit type. Be especially careful with breaking changes.
192120

193121
## Releases
194122

195-
For each new commit added to `main` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.
123+
For each new commit added to `main`, a GitHub Workflow is triggered which runs the [Changesets Action](https://github.com/changesets/action). This generates a preview PR showing the impact of all changesets. When this PR is merged, the package will be published to NPM.

packages/config/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
22

3-
import { tanstackConfig } from './src/eslint/index.js'
3+
import { tanstackConfig } from '../eslint-config/src/index.js'
44

55
export default [...tanstackConfig]

packages/config/package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,23 @@
6060
},
6161
"dependencies": {
6262
"@commitlint/parse": "catalog:",
63-
"@eslint/js": "catalog:",
64-
"@stylistic/eslint-plugin-js": "catalog:",
63+
"@tanstack/eslint-config": "workspace:*",
6564
"@tanstack/typedoc-config": "workspace:*",
6665
"commander": "catalog:",
6766
"esbuild-register": "catalog:",
68-
"eslint-plugin-import-x": "catalog:",
69-
"eslint-plugin-n": "catalog:",
70-
"globals": "catalog:",
7167
"interpret": "catalog:",
7268
"jsonfile": "catalog:",
7369
"liftoff": "catalog:",
7470
"minimist": "catalog:",
7571
"rollup-plugin-preserve-directives": "catalog:",
7672
"semver": "catalog:",
7773
"simple-git": "catalog:",
78-
"typescript-eslint": "catalog:",
7974
"v8flags": "catalog:",
8075
"vite-plugin-dts": "catalog:",
8176
"vite-plugin-externalize-deps": "catalog:",
82-
"vite-tsconfig-paths": "catalog:",
83-
"vue-eslint-parser": "catalog:"
77+
"vite-tsconfig-paths": "catalog:"
8478
},
8579
"devDependencies": {
86-
"@types/eslint": "catalog:",
8780
"@types/interpret": "catalog:",
8881
"@types/jsonfile": "catalog:",
8982
"@types/liftoff": "catalog:",
Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1 @@
1-
import tseslint from 'typescript-eslint'
2-
import vueparser from 'vue-eslint-parser'
3-
import stylisticJs from '@stylistic/eslint-plugin-js'
4-
import pluginImport from 'eslint-plugin-import-x'
5-
import pluginNode from 'eslint-plugin-n'
6-
import globals from 'globals'
7-
import { javascriptRules } from './javascript.js'
8-
import { importRules } from './import.js'
9-
import { typescriptRules } from './typescript.js'
10-
import { nodeRules } from './node.js'
11-
import { stylisticRules } from './stylistic.js'
12-
13-
const JS_GLOB_INCLUDE = ['**/*.{js,ts,tsx}']
14-
const VUE_GLOB_INCLUDE = ['**/*.vue']
15-
16-
const GLOB_EXCLUDE = [
17-
'**/.nx/**',
18-
'**/.svelte-kit/**',
19-
'**/build/**',
20-
'**/coverage/**',
21-
'**/dist/**',
22-
'**/snap/**',
23-
'**/vite.config.*.timestamp-*.*',
24-
]
25-
26-
const jsRules = {
27-
...javascriptRules,
28-
...typescriptRules,
29-
...importRules,
30-
...nodeRules,
31-
...stylisticRules,
32-
}
33-
34-
const jsPlugins = {
35-
'@stylistic/js': stylisticJs,
36-
'@typescript-eslint': tseslint.plugin,
37-
import: pluginImport,
38-
node: pluginNode,
39-
}
40-
41-
/** @type {import('eslint').Linter.Config[]} */
42-
export const tanstackConfig = [
43-
{
44-
name: 'tanstack/ignores',
45-
ignores: GLOB_EXCLUDE,
46-
},
47-
{
48-
name: 'tanstack/setup',
49-
files: JS_GLOB_INCLUDE,
50-
languageOptions: {
51-
sourceType: 'module',
52-
ecmaVersion: 2020,
53-
// @ts-expect-error
54-
parser: tseslint.parser,
55-
parserOptions: {
56-
project: true,
57-
parser: tseslint.parser,
58-
},
59-
globals: {
60-
...globals.browser,
61-
},
62-
},
63-
// @ts-expect-error
64-
plugins: jsPlugins,
65-
rules: jsRules,
66-
},
67-
{
68-
name: 'tanstack/vue',
69-
files: VUE_GLOB_INCLUDE,
70-
languageOptions: {
71-
parser: vueparser,
72-
parserOptions: {
73-
sourceType: 'module',
74-
ecmaVersion: 2020,
75-
parser: tseslint.parser,
76-
project: true,
77-
extraFileExtensions: ['.vue'],
78-
},
79-
globals: {
80-
...globals.browser,
81-
},
82-
},
83-
// @ts-expect-error
84-
plugins: jsPlugins,
85-
rules: jsRules,
86-
},
87-
]
1+
export { tanstackConfig } from '@tanstack/eslint-config'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @ts-check
2+
3+
import { tanstackConfig } from '../eslint-config/src/index.js'
4+
5+
export default [...tanstackConfig]
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "@tanstack/eslint-config",
3+
"version": "0.0.0",
4+
"description": "Configuration and tools for publishing and maintaining TanStack projects.",
5+
"author": "tannerlinsley",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/TanStack/config.git",
10+
"directory": "packages/eslint-config"
11+
},
12+
"homepage": "https://tanstack.com/config",
13+
"funding": {
14+
"type": "github",
15+
"url": "https://github.com/sponsors/tannerlinsley"
16+
},
17+
"scripts": {
18+
"test:types": "tsc",
19+
"test:eslint": "eslint ./src",
20+
"test:build": "publint --strict"
21+
},
22+
"type": "module",
23+
"exports": {
24+
".": {
25+
"import": {
26+
"default": "./src/index.js"
27+
}
28+
},
29+
"./package.json": "./package.json"
30+
},
31+
"preferGlobal": false,
32+
"sideEffects": false,
33+
"files": [
34+
"src"
35+
],
36+
"engines": {
37+
"node": ">=18"
38+
},
39+
"dependencies": {
40+
"@eslint/js": "catalog:",
41+
"@stylistic/eslint-plugin-js": "catalog:",
42+
"esbuild-register": "catalog:",
43+
"eslint-plugin-import-x": "catalog:",
44+
"eslint-plugin-n": "catalog:",
45+
"globals": "catalog:",
46+
"typescript-eslint": "catalog:",
47+
"vue-eslint-parser": "catalog:"
48+
},
49+
"devDependencies": {
50+
"@types/eslint": "catalog:",
51+
"eslint": "catalog:"
52+
}
53+
}

0 commit comments

Comments
 (0)