Skip to content

Commit

Permalink
Merge branch 'main' into nickmccurdy-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmccurdy committed Sep 20, 2021
2 parents c597fc0 + a5fc94f commit c92a998
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 85 deletions.
19 changes: 19 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,25 @@
"code",
"bug"
]
},
{
"login": "huyenltnguyen",
"name": "Huyen Nguyen",
"avatar_url": "https://avatars.githubusercontent.com/u/25715018?v=4",
"profile": "https://github.com/huyenltnguyen",
"contributions": [
"doc"
]
},
{
"login": "mdotwills",
"name": "Matthew",
"avatar_url": "https://avatars.githubusercontent.com/u/5505611?v=4",
"profile": "https://github.com/mdotwills",
"contributions": [
"bug",
"code"
]
}
]
}
39 changes: 0 additions & 39 deletions .github/workflows/eslint-plugin-jest-dom.yml

This file was deleted.

24 changes: 12 additions & 12 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ name: Smoke test

on:
schedule:
- cron: '0 0 * * SUN'
- cron: "0 0 * * SUN"
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.11
- run: yarn install
- run: yarn build
- run: yarn link
- run: yarn link eslint-plugin-jest-dom
- run: yarn test:smoke
env:
CI: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: yarn install
- run: yarn build
- run: yarn link
- run: yarn link eslint-plugin-jest-dom
- run: yarn test:smoke
env:
CI: true
87 changes: 87 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: validate
on:
push:
branches:
- "+([0-9])?(.{+([0-9]),x}).x"
- "main"
- "next"
- "next-major"
- "beta"
- "alpha"
- "!all-contributors/**"
pull_request: {}
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
node: [12, 14, 16]
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1

- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ▶️ Run validate script
run: npm run validate

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v2

release:
needs: main
runs-on: ubuntu-latest
if: ${{ github.repository == 'testing-library/eslint-plugin-jest-dom' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1

- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: 16

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🏗 Run build script
run: npm run build

- run: ls -asl dist

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![MIT License][license-badge]][license]

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
[![PRs Welcome][prs-badge]][prs]
[![Code of Conduct][coc-badge]][coc]
Expand Down Expand Up @@ -46,7 +46,7 @@ should be installed as one of your project's `devDependencies`:
npm install --save-dev eslint-plugin-jest-dom
```

This library has a required `peerDependencies` listing for [`eslint`][eslint]
This library has a required `peerDependencies` listing for [`ESLint`](https://eslint.org/).

## Usage

Expand Down Expand Up @@ -101,19 +101,19 @@ module.exports = {

<!-- __BEGIN AUTOGENERATED TABLE__ -->

| Name | 👍 | 🔧 | Description |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | --------------------------------------------------------------------- |
| [prefer-checked](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-checked.md) | 👍 | 🔧 | prefer toBeChecked over checking attributes |
| [prefer-empty](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-empty.md) | 👍 | 🔧 | Prefer toBeEmpty over checking innerHTML |
| [prefer-enabled-disabled](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-enabled-disabled.md) | 👍 | 🔧 | prefer toBeDisabled or toBeEnabled over checking attributes |
| [prefer-focus](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-focus.md) | 👍 | 🔧 | prefer toHaveFocus over checking document.activeElement |
| [prefer-in-document](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-in-document.md) | 👍 | 🔧 | Prefer .toBeInTheDocument() for asserting the existence of a DOM node |
| [prefer-required](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-required.md) | 👍 | 🔧 | prefer toBeRequired over checking properties |
| [prefer-to-have-attribute](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-attribute.md) | 👍 | 🔧 | prefer toHaveAttribute over checking getAttribute/hasAttribute |
| [prefer-to-have-class](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-class.md) | 👍 | 🔧 | prefer toHaveClass over checking element className |
| [prefer-to-have-style](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-style.md) | 👍 | 🔧 | prefer toHaveStyle over checking element style |
| [prefer-to-have-text-content](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-text-content.md) | 👍 | 🔧 | Prefer toHaveTextContent over checking element.textContent |
| [prefer-to-have-value](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-value.md) | 👍 | 🔧 | prefer toHaveValue over checking element.value |
| Name | 👍 | 🔧 | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | --------------------------------------------------------------------- |
| [prefer-checked](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-checked.md) | 👍 | 🔧 | prefer toBeChecked over checking attributes |
| [prefer-empty](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-empty.md) | 👍 | 🔧 | Prefer toBeEmpty over checking innerHTML |
| [prefer-enabled-disabled](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-enabled-disabled.md) | 👍 | 🔧 | prefer toBeDisabled or toBeEnabled over checking attributes |
| [prefer-focus](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-focus.md) | 👍 | 🔧 | prefer toHaveFocus over checking document.activeElement |
| [prefer-in-document](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-in-document.md) | 👍 | 🔧 | Prefer .toBeInTheDocument() for asserting the existence of a DOM node |
| [prefer-required](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-required.md) | 👍 | 🔧 | prefer toBeRequired over checking properties |
| [prefer-to-have-attribute](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-attribute.md) | 👍 | 🔧 | prefer toHaveAttribute over checking getAttribute/hasAttribute |
| [prefer-to-have-class](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-class.md) | 👍 | 🔧 | prefer toHaveClass over checking element className |
| [prefer-to-have-style](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-style.md) | 👍 | 🔧 | prefer toHaveStyle over checking element style |
| [prefer-to-have-text-content](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-text-content.md) | 👍 | 🔧 | Prefer toHaveTextContent over checking element.textContent |
| [prefer-to-have-value](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-value.md) | 👍 | 🔧 | prefer toHaveValue over checking element.value |

<!-- __END AUTOGENERATED TABLE__ -->

Expand Down Expand Up @@ -163,6 +163,8 @@ Thanks goes to these people ([emoji key][emojis]):
</tr>
<tr>
<td align="center"><a href="https://github.com/G-Rath"><img src="https://avatars.githubusercontent.com/u/3151613?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gareth Jones</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=G-Rath" title="Tests">⚠️</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=G-Rath" title="Code">💻</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3AG-Rath" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/huyenltnguyen"><img src="https://avatars.githubusercontent.com/u/25715018?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Huyen Nguyen</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=huyenltnguyen" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/mdotwills"><img src="https://avatars.githubusercontent.com/u/5505611?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matthew</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3Amdotwills" title="Bug reports">🐛</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=mdotwills" title="Code">💻</a></td>
</tr>
</table>

Expand Down Expand Up @@ -190,11 +192,11 @@ MIT
[downloads-badge]: https://img.shields.io/npm/dm/eslint-plugin-jest-dom.svg?style=flat-square
[npmtrends]: http://www.npmtrends.com/eslint-plugin-jest-dom
[license-badge]: https://img.shields.io/npm/l/eslint-plugin-jest-dom.svg?style=flat-square
[license]: https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/LICENSE
[license]: https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prs]: http://makeapullrequest.com
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
[coc]: https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/other/CODE_OF_CONDUCT.md
[coc]: https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/other/CODE_OF_CONDUCT.md
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
[all-contributors]: https://github.com/all-contributors/all-contributors
[bugs]: https://github.com/testing-library/eslint-plugin-jest-dom/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Acreated-desc+label%3Abug
Expand Down
2 changes: 1 addition & 1 deletion build/generate-readme-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const expectedTableLines = Object.keys(rules)

lines.push(
[
`[${ruleId}](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/${ruleId}.md)`,
`[${ruleId}](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/${ruleId}.md)`,
rule.meta.docs.recommended ? "👍" : "",
rule.meta.fixable ? "🔧" : "",
rule.meta.docs.description,
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/prefer-empty.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Don't use this rule if you don't care if people use `.toBeEmptyDOMElement()`.

<https://github.com/testing-library/jest-dom#tobeemptydomelement>

<https://github.com/testing-library/jest-dom/blob/master/src/to-be-empty-dom-element.js>
<https://github.com/testing-library/jest-dom/blob/main/src/to-be-empty-dom-element.js>

## Changelog

Expand Down
2 changes: 1 addition & 1 deletion other/MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ to release. See the next section on Releases for more about that.

## Release

Our releases are automatic. They happen whenever code lands into `master`. A
Our releases are automatic. They happen whenever code lands into `main`. A
travis build gets kicked off and if it's successful, a tool called
[`semantic-release`](https://github.com/semantic-release/semantic-release) is
used to automatically publish a new release to npm as well as a changelog to
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
"validate": "kcd-scripts validate"
},
"dependencies": {
"@babel/runtime": "^7.9.6",
"@testing-library/dom": "^7.28.1",
"@babel/runtime": "^7.15.4",
"@testing-library/dom": "^7.31.2",
"requireindex": "^1.2.0"
},
"devDependencies": {
"@typescript-eslint/parser": "^4.8.2",
"eslint": "7.24",
"eslint-remote-tester": "^0.3.3",
"@typescript-eslint/parser": "^4.31.1",
"eslint": "^7.31.0",
"eslint-remote-tester": "^1.3.1",
"jest-extended": "^0.11.5",
"kcd-scripts": "6.5.1",
"typescript": "^4.1.2"
"kcd-scripts": "^11.2.2",
"typescript": "^4.4.3"
},
"peerDependencies": {
"eslint": ">=6.8"
Expand Down
2 changes: 1 addition & 1 deletion smoke-test/eslint-remote-tester.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
/** Repositories to scan */
repositories: require("./repositories.json"),
repositories: require("./repositories"),

/** Extensions of files under scanning */
extensions: ["js", "jsx", "ts", "tsx"],
Expand Down

0 comments on commit c92a998

Please sign in to comment.