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

removed regextra library to reduce dependencies #865

Merged
merged 3 commits into from
Apr 8, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ os: linux
dist: xenial
language: node_js
node_js:
- "12.22.0"
- "14.17.0"
- "16"
- "17"
install:
- npm install --legacy-peer-deps
before_script: >
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"debug": "^4.3.4",
"escape-string-regexp": "^4.0.0",
"esquery": "^1.4.0",
"regextras": "^0.8.0",
"semver": "^7.3.6",
"spdx-expression-parse": "^3.0.1"
},
Expand Down Expand Up @@ -48,7 +47,7 @@
"typescript": "^4.6.3"
},
"engines": {
"node": "^12 || ^14 || ^16 || ^17"
"node": "^14 || ^16 || ^17"
},
"keywords": [
"eslint",
Expand Down
10 changes: 2 additions & 8 deletions src/rules/requireDescriptionCompleteSentence.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import escapeStringRegexp from 'escape-string-regexp';
import {
RegExtras,
} from 'regextras/dist/main-umd';
import iterateJsdoc from '../iterateJsdoc';

const otherDescriptiveTags = new Set([
Expand All @@ -25,12 +22,9 @@ const extractSentences = (text, abbreviationsRegex) => {
// Remove custom abbreviations
.replace(abbreviationsRegex, '');

const sentenceEndGrouping = /([.?!])(?:\s+|$)/u;
const sentenceEndGrouping = /([.?!])(?:\s+|$)/ug;

// eslint-disable-next-line unicorn/no-array-method-this-argument
const puncts = new RegExtras(sentenceEndGrouping).map(txt, (punct) => {
return punct;
});
const puncts = txt.matchAll(sentenceEndGrouping);

return txt

Expand Down