Skip to content

Commit

Permalink
feat: Update deps, drop Node 6 support
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

- Node 6 is no longer supported, the earliest supported version is  Node 8.9
  • Loading branch information
sapegin committed Jan 14, 2020
1 parent f9832bf commit b11c501
Show file tree
Hide file tree
Showing 12 changed files with 5,535 additions and 4,976 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# editorconfig.org
root = true

[*]
indent_style = tab
Expand All @@ -7,6 +8,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,yml,md,babelrc,eslintrc,lintstagedrc,remarkrc}]
[*.{json,yml,md,babelrc,remarkrc}]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node_modules
node_modules/
2 changes: 1 addition & 1 deletion .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "tamia"
}
}
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
node_modules
.DS_Store
Thumbs.db
.idea
.vscode
*.sublime-project
*.sublime-workspace
*.log
Changelog.md
Changelog.md
node_modules/
.idea/
.vscode/
yarn.lock
.eslintcache
17 changes: 17 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"useTabs": true,
"endOfLine": "lf",
"singleQuote": true,
"trailingComma": "es5",
"overrides": [
{
"files": "*.md",
"options": {
"printWidth": 70,
"useTabs": false,
"trailingComma": "none",
"proseWrap": "never"
}
}
]
}
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ language: node_js
cache:
directories:
- node_modules
yarn: true
node_js:
- 6
- 7
- 12
- 10
- 8
after_success:
- npm run semantic-release
- npx semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
24 changes: 5 additions & 19 deletions License.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
The MIT License
===============
# The MIT License

Copyright 2017 Artem Sapegin (http://sapegin.me), contributors
Copyright 2020 Artem Sapegin, contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 changes: 4 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# textlint-rule-apostrophe

[![textlint fixable rule](https://img.shields.io/badge/textlint-fixable-green.svg?style=social)](https://textlint.github.io/)
[![Build Status](https://travis-ci.org/sapegin/textlint-rule-apostrophe.svg)](https://travis-ci.org/sapegin/textlint-rule-apostrophe)
[![npm](https://img.shields.io/npm/v/textlint-rule-apostrophe.svg)](https://www.npmjs.com/package/textlint-rule-apostrophe)
[![textlint fixable rule](https://img.shields.io/badge/textlint-fixable-green.svg?style=social)](https://textlint.github.io/) [![Build Status](https://travis-ci.org/sapegin/textlint-rule-apostrophe.svg)](https://travis-ci.org/sapegin/textlint-rule-apostrophe) [![npm](https://img.shields.io/npm/v/textlint-rule-apostrophe.svg)](https://www.npmjs.com/package/textlint-rule-apostrophe)

[Textlint](https://github.com/textlint/textlint) rule to check and fix correct apostrophe usage: replace `'` and `` with ``.

Expand Down Expand Up @@ -34,9 +32,9 @@ textlint --fix --rule apostrophe Readme.md

## Other textlint rules

* [textlint-rule-diacritics](https://github.com/sapegin/textlint-rule-diacritics) — words with diacritics
* [textlint-rule-stop-words](https://github.com/sapegin/textlint-rule-stop-words) — filler words, buzzwords and clichés
* [textlint-rule-terminology](https://github.com/sapegin/textlint-rule-terminology) — correct terms spelling
- [textlint-rule-diacritics](https://github.com/sapegin/textlint-rule-diacritics) — words with diacritics
- [textlint-rule-stop-words](https://github.com/sapegin/textlint-rule-stop-words) — filler words, buzzwords and clichés
- [textlint-rule-terminology](https://github.com/sapegin/textlint-rule-terminology) — correct terms spelling

## Change log

Expand Down
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ function reporter(context) {
const text = getSource(node);

let match;
while (match = evilApostropheRegExp.exec(text)) { // eslint-disable-line no-cond-assign
// eslint-disable-next-line no-cond-assign
while ((match = evilApostropheRegExp.exec(text))) {
const index = match.index;
const matched = match[0];
const replacement = matched.replace(evilApostrophe, goodApostrophe);
const range = [index, index + matched.length];
const fix = fixer.replaceTextRange(range, replacement);
const message = `Incorrect usage of an apostrophe: “${matched}”, use “${replacement}” instead`;
report(node, new RuleError(message, { index, fix }));
report(
node,
new RuleError(message, {
index,
fix,
})
);
}

resolve();
Expand Down
Loading

0 comments on commit b11c501

Please sign in to comment.