Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite html plugin #23

Merged
merged 23 commits into from
Jan 29, 2023
Merged
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
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

26 changes: 21 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,31 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14]
node-version: [16,18]
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm install
run: yarn install
- name: Test
run: npm test
run: yarn test
example:
name: "Run Example"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: yarn install
working-directory: ./example
- name: Test
run: yarn test
working-directory: ./example
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/lib
/module
### https://raw.github.com/github/gitignore/608690d6b9a78c2a003affc792e49a84905b3118/Node.gitignore

# Logs
Expand Down
10 changes: 6 additions & 4 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"timeout": "5000",
"require": [
"@babel/register"
]
"$schema": "https://json.schemastore.org/mocharc",
"loader": "ts-node/esm",
"spec": [
"test/**/*.{js,ts}"
],
"timeout": 10000
}
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

Add HTML support for [textlint](https://github.com/textlint/textlint "textlint").

What is textlint plugin? Please see https://github.com/textlint/textlint/blob/master/docs/plugin.md

What is textlint plugin? Please see <https://github.com/textlint/textlint/blob/master/docs/plugin.md>

## Installation

npm install textlint-plugin-html

Requirements:

- textlint v13+

## Default supported extensions

- `.html`
Expand Down Expand Up @@ -52,6 +55,16 @@ For example, if you want to treat `.custom-ext` as html, put following config to

npm test

## Development

If you update snapshot, please run `npm run updateSnapshot`.

### Add new test case

1. add new fixture file to `test/ast-test-case/<test-case-name>/index.html`
2. npm run updateSnapshot
3. check outputs

## Contributing

1. Fork it!
Expand Down
30 changes: 30 additions & 0 deletions example/.github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
changelog:
exclude:
labels:
- 'Type: Meta'
- 'Type: Question'
- 'Type: Release'

categories:
- title: Security Fixes
labels: ['Type: Security']
- title: Breaking Changes
labels: ['Type: Breaking Change']
- title: Features
labels: ['Type: Feature']
- title: Bug Fixes
labels: ['Type: Bug']
- title: Documentation
labels: ['Type: Documentation']
- title: Refactoring
labels: ['Type: Refactoring']
- title: Testing
labels: ['Type: Testing']
- title: Maintenance
labels: ['Type: Maintenance']
- title: CI
labels: ['Type: CI']
- title: Dependency Updates
labels: ['Type: Dependencies', "dependencies"]
- title: Other Changes
labels: ['*']
11 changes: 11 additions & 0 deletions example/.textlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": [
"html"
],
"filters": {},
"rules": {
"preset-ja-technical-writing": {
"ja-no-mixed-period": false
}
}
}
20 changes: 20 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"private": true,
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "textlint test/ -f pretty-error || exit 0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example test

},
"workspaces": [
"../"
],
"author": "azu",
"license": "MIT",
"devDependencies": {
"textlint": "^13.0.5",
"textlint-rule-preset-ja-technical-writing": "^7.0.0",
"textlint-plugin-html": "^0.3.0"
}
}
Loading