Skip to content

Commit cf75e0b

Browse files
authored
chore: minor improvements (#708)
* chore: update author's email * chore: update description * chore: remove references to test snapshots * chore: adjust eslint docs generator * ci: avoid excluding all-contributors branches * refactor: rename generate scripts * chore: enable pre and post scripts for pnpm * chore: remove stale dist before building
1 parent 98cb755 commit cf75e0b

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

.eslint-doc-generatorrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const prettier = require('prettier');
2+
const prettierConfig = require('./.prettierrc.js');
3+
4+
/** @type {import('eslint-doc-generator').GenerateOptions} */
5+
const config = {
6+
postprocess: (content) =>
7+
prettier.format(content, { ...prettierConfig, parser: 'markdown' }),
8+
};
9+
10+
module.exports = config;

.github/workflows/pipeline.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name: Pipeline
33
on:
44
push:
55
branches:
6-
# semantic-release valid branches, excluding all-contributors
6+
# semantic-release valid branches
77
- '+([0-9])?(.{+([0-9]),x}).x'
88
- 'main'
99
- 'next'
1010
- 'next-major'
1111
- 'beta'
1212
- 'alpha'
13-
- '!all-contributors/**'
1413
pull_request:
1514
types: [opened, synchronize]
1615

@@ -46,7 +45,7 @@ jobs:
4645
run: npm run format:check
4746

4847
- name: Check autogenerated docs
49-
run: npm run docs:gen && npm run format && git diff --exit-code
48+
run: npm run generate-all && git diff --exit-code
5049

5150
tests:
5251
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }})

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
package-lock=false
22
auto-install-peers=true
3+
enable-pre-post-scripts=true

CONTRIBUTING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ The following will be run on every commit:
3838
- Check all tests are passing
3939
- Check commit message is following [Conventional Commit specification](https://www.conventionalcommits.org/en/v1.0.0/)
4040
41-
If you ever need to update a snapshot, you can run `npm run test:update`
42-
4341
## Rule naming conventions
4442
4543
Based on [ESLint's Rule Naming Conventions](https://eslint.org/docs/developer-guide/working-with-rules#rule-naming-conventions), you must follow these rules:
@@ -65,7 +63,7 @@ each rule has three files named with its identifier (e.g. `no-debugging-utils`):
6563
6664
Additionally, you need to do a couple of extra things:
6765
68-
- Run `npm run generate:rules-list` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
66+
- Run `npm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
6967
7068
### Custom rule creator
7169

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eslint-plugin-testing-library",
33
"version": "0.0.0-semantically-released",
4-
"description": "ESLint rules for Testing Library",
4+
"description": "ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library",
55
"keywords": [
66
"eslint",
77
"eslintplugin",
@@ -21,16 +21,17 @@
2121
"license": "MIT",
2222
"author": {
2323
"name": "Mario Beltrán Alarcón",
24-
"email": "[email protected]",
24+
"email": "[email protected]",
2525
"url": "https://mario.dev/"
2626
},
2727
"main": "index.js",
2828
"scripts": {
29+
"prebuild": "del-cli dist",
2930
"build": "tsc",
3031
"postbuild": "cpy README.md ./dist && cpy package.json ./dist && cpy LICENSE ./dist",
31-
"docs:gen": "run-p \"docs:gen:*\"",
32-
"docs:gen:configs": "ts-node tools/generate-configs",
33-
"docs:gen:rules-list": "npm run build && npm run rule-doc-generator && npm run format",
32+
"generate-all": "run-p \"generate:*\"",
33+
"generate:configs": "ts-node tools/generate-configs",
34+
"generate:rules-doc": "npm run build && npm run rule-doc-generator",
3435
"format": "npm run prettier-base -- --write",
3536
"format:check": "npm run prettier-base -- --check",
3637
"lint": "eslint . --max-warnings 0 --ext .js,.ts",
@@ -41,7 +42,6 @@
4142
"semantic-release": "semantic-release",
4243
"test": "jest",
4344
"test:ci": "jest --ci --coverage",
44-
"test:update": "npm run test -- --u",
4545
"test:watch": "npm run test -- --watch",
4646
"type-check": "tsc --noEmit"
4747
},
@@ -59,6 +59,7 @@
5959
"@typescript-eslint/eslint-plugin": "^5.43.0",
6060
"@typescript-eslint/parser": "^5.43.0",
6161
"cpy-cli": "^4.2.0",
62+
"del-cli": "^5.0.0",
6263
"eslint": "^8.28.0",
6364
"eslint-config-kentcdodds": "^20.4.0",
6465
"eslint-config-prettier": "^8.5.0",

0 commit comments

Comments
 (0)