Skip to content

Commit 7427e21

Browse files
committed
## 1.8.0 - August 2021
* Closes #11, Improves the specification of the number of the line of the found error for the final report, Thanks to Maxim-Mazurok for His collaboration.
1 parent 889a5eb commit 7427e21

File tree

7 files changed

+978
-872
lines changed

7 files changed

+978
-872
lines changed

.gitlab-ci.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,22 @@ test:
4444
untracked: true
4545
paths:
4646
- node_modules/
47+
artifacts:
48+
when: always
49+
paths:
50+
- build/coverage/lcov-report/
4751

48-
pack:
52+
pages:
4953
stage: assemble
54+
dependencies:
55+
- test
5056
script:
51-
- mkdir -p build
52-
- cd build
53-
- npm pack ../
54-
cache:
55-
key: "${CI_COMMIT_SHA}"
56-
policy: pull
57-
untracked: true
58-
paths:
59-
- node_modules/
57+
- mkdir -p to_public
58+
- touch to_public/index.html
59+
- mv build/coverage/lcov-report/ to_public/coverage
60+
- mv to_public public
6061
artifacts:
61-
name: $CI_PROJECT_NAME-$(date +%Y%m%d-%H%M)-$CI_COMMIT_SHORT_SHA
6262
paths:
63-
- ./build/*.tgz
63+
- public
64+
only:
65+
- master

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ESLint Plugin Regex Change Log
22

3+
## 1.8.0 - August 2021
4+
5+
* Closes #11, Improves the specification of the number of the line of the found error for the final report, Thanks to Maxim-Mazurok for His collaboration.
6+
37
## 1.7.0 - February 2021
48

59
* Closes #6, Removes the requirement of `return` presence for replacement functions for invalid patterns.

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<p align="center">
22
<br/>
3-
<img src="https://assets.gitlab-static.net/uploads/-/system/project/avatar/16770425/eslint-plugin-regex.png" alt=" "/>
3+
<a href="https://eslint-plugin-regex.github.io/"><img src="https://assets.gitlab-static.net/uploads/-/system/project/avatar/16770425/eslint-plugin-regex.png" alt=" "/></a>
44
</p>
55

66
<h1 align="center">ESLint rules using Regular Expressions</h1>
77

8+
[![eslint-plugin-regex](https://badgen.net/badge/homepage/eslint-plugin-regex/blue)](https://eslint-plugin-regex.github.io/)
89
[![eslint-plugin-regex](https://badgen.net/badge/npm%20pack/eslint-plugin-regex/blue)](https://www.npmjs.com/package/eslint-plugin-regex)
910
[![ ](https://badgen.net/npm/v/eslint-plugin-regex)](https://www.npmjs.com/package/eslint-plugin-regex)
1011
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE.txt)
11-
[![ ](https://gitlab.com/gmullerb/eslint-plugin-regex/badges/master/coverage.svg)](https://gitlab.com/gmullerb/eslint-plugin-regex/pipelines)
12+
[![ ](https://gitlab.com/gmullerb/eslint-plugin-regex/badges/master/coverage.svg)](https://gmullerb.gitlab.io/eslint-plugin-regex/coverage/index.html)
1213
[![Github repo](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/gmullerb/eslint-plugin-regex)
1314
[![Gitlab repo](https://badgen.net/badge/icon/gitlab?icon=gitlab&label)](https://gitlab.com/gmullerb/eslint-plugin-regex)
15+
1416
__________________
1517

1618
## Quick Start
@@ -23,7 +25,7 @@ __________________
2325
..
2426
"devDependencies": {
2527
"eslint": ">=4.0.0",
26-
"eslint-plugin-regex": "1.7.0",
28+
"eslint-plugin-regex": "1.8.0",
2729
..
2830
```
2931

@@ -676,11 +678,12 @@ __________________
676678

677679
## Documentation
678680

679-
* [`CHANGELOG.md`](CHANGELOG.md): add information of notable changes for each version here, chronologically ordered ([Keep a Changelog](http://keepachangelog.com)).
681+
* [`CHANGELOG.md`](CHANGELOG.md): contains the information about changes in each version, chronologically ordered ([Keep a Changelog](http://keepachangelog.com)).
680682

681683
## License
682684

683685
[MIT License](LICENSE.txt)
686+
684687
__________________
685688

686689
## Remember

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: eslint-plugin-regex

lib/rules/invalid-regex-rule.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,15 @@ function checkRegexInSource(source, regex) {
4646
}
4747
}
4848

49-
function foundStart(source, nextLine, foundAt) {
49+
function foundStart(source, foundAt) {
5050
return Array.from(source.substring(0, foundAt))
5151
.reduce((result, char) => char === '\n'
5252
? { line: result.line + 1, column: 0 }
5353
: { line: result.line, column: result.column + 1 },
54-
{ line: nextLine, column: 0 })
54+
{ line: 1, column: 0 })
5555
}
5656

5757
function checkRegex(source, sourceLines, nextLine, nextChar, rootChar, pattern, replace, report, originalSource) {
58-
originalSource = originalSource || source
5958
if (source.length !== 0) {
6059
const sourceDetail = checkRegexInSource(source, pattern.regex)
6160
if (sourceDetail.patternIndex !== -1) {
@@ -81,7 +80,7 @@ function checkRegex(source, sourceLines, nextLine, nextChar, rootChar, pattern,
8180
}
8281
else {
8382
report({
84-
loc: { start: foundStart(originalSource, 1, sourceDetail.patternIndex + rootChar) },
83+
loc: { start: foundStart(originalSource, sourceDetail.patternIndex + rootChar) },
8584
message: formatReportMessage(
8685
pattern,
8786
from => `Invalid regular expression ${from} found`
@@ -143,7 +142,8 @@ function checkPatterns(fileName, source, patterns, report) {
143142
0,
144143
pattern,
145144
createReplacement(pattern.details.replacement),
146-
report
145+
report,
146+
source
147147
))
148148
}
149149

0 commit comments

Comments
 (0)