Skip to content

Commit

Permalink
chore: minor improvements (#708)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Belco90 committed Jan 5, 2023
1 parent 98cb755 commit cf75e0b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .eslint-doc-generatorrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const prettier = require('prettier');
const prettierConfig = require('./.prettierrc.js');

/** @type {import('eslint-doc-generator').GenerateOptions} */
const config = {
postprocess: (content) =>
prettier.format(content, { ...prettierConfig, parser: 'markdown' }),
};

module.exports = config;
5 changes: 2 additions & 3 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ name: Pipeline
on:
push:
branches:
# semantic-release valid branches, excluding all-contributors
# semantic-release valid branches
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
- '!all-contributors/**'
pull_request:
types: [opened, synchronize]

Expand Down Expand Up @@ -46,7 +45,7 @@ jobs:
run: npm run format:check

- name: Check autogenerated docs
run: npm run docs:gen && npm run format && git diff --exit-code
run: npm run generate-all && git diff --exit-code

tests:
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }})
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
package-lock=false
auto-install-peers=true
enable-pre-post-scripts=true
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ The following will be run on every commit:
- Check all tests are passing
- Check commit message is following [Conventional Commit specification](https://www.conventionalcommits.org/en/v1.0.0/)

If you ever need to update a snapshot, you can run `npm run test:update`

## Rule naming conventions

Based on [ESLint's Rule Naming Conventions](https://eslint.org/docs/developer-guide/working-with-rules#rule-naming-conventions), you must follow these rules:
Expand All @@ -65,7 +63,7 @@ each rule has three files named with its identifier (e.g. `no-debugging-utils`):

Additionally, you need to do a couple of extra things:

- Run `npm run generate:rules-list` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
- Run `npm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)

### Custom rule creator

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-testing-library",
"version": "0.0.0-semantically-released",
"description": "ESLint rules for Testing Library",
"description": "ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library",
"keywords": [
"eslint",
"eslintplugin",
Expand All @@ -21,16 +21,17 @@
"license": "MIT",
"author": {
"name": "Mario Beltrán Alarcón",
"email": "belco90@gmail.com",
"email": "me@mario.dev",
"url": "https://mario.dev/"
},
"main": "index.js",
"scripts": {
"prebuild": "del-cli dist",
"build": "tsc",
"postbuild": "cpy README.md ./dist && cpy package.json ./dist && cpy LICENSE ./dist",
"docs:gen": "run-p \"docs:gen:*\"",
"docs:gen:configs": "ts-node tools/generate-configs",
"docs:gen:rules-list": "npm run build && npm run rule-doc-generator && npm run format",
"generate-all": "run-p \"generate:*\"",
"generate:configs": "ts-node tools/generate-configs",
"generate:rules-doc": "npm run build && npm run rule-doc-generator",
"format": "npm run prettier-base -- --write",
"format:check": "npm run prettier-base -- --check",
"lint": "eslint . --max-warnings 0 --ext .js,.ts",
Expand All @@ -41,7 +42,6 @@
"semantic-release": "semantic-release",
"test": "jest",
"test:ci": "jest --ci --coverage",
"test:update": "npm run test -- --u",
"test:watch": "npm run test -- --watch",
"type-check": "tsc --noEmit"
},
Expand All @@ -59,6 +59,7 @@
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"cpy-cli": "^4.2.0",
"del-cli": "^5.0.0",
"eslint": "^8.28.0",
"eslint-config-kentcdodds": "^20.4.0",
"eslint-config-prettier": "^8.5.0",
Expand Down

0 comments on commit cf75e0b

Please sign in to comment.