Skip to content

Commit

Permalink
ESLint: Added regexp/no-useless-flag rule (#3150)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Oct 14, 2021
1 parent 71b7d46 commit 3c61c8f
Show file tree
Hide file tree
Showing 68 changed files with 84 additions and 83 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -75,6 +75,7 @@ module.exports = {
'regexp/no-trivially-nested-assertion': 'warn',
'regexp/no-trivially-nested-quantifier': 'warn',
'regexp/no-useless-character-class': 'warn',
'regexp/no-useless-flag': 'warn',
'regexp/no-useless-lazy': 'warn',
'regexp/prefer-plus-quantifier': 'warn',
'regexp/prefer-question-quantifier': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion components/prism-abap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-abap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions components/prism-ada.js
@@ -1,6 +1,6 @@
Prism.languages.ada = {
'comment': /--.*/,
'string': /"(?:""|[^"\r\f\n])*"/i,
'string': /"(?:""|[^"\r\f\n])*"/,
'number': [
{
pattern: /\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i
Expand All @@ -9,7 +9,7 @@ Prism.languages.ada = {
pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i
}
],
'attr-name': /\b'\w+/i,
'attr-name': /\b'\w+/,
'keyword': /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,
'boolean': /\b(?:false|true)\b/i,
'operator': /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-ada.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions components/prism-aspnet.js
@@ -1,6 +1,6 @@
Prism.languages.aspnet = Prism.languages.extend('markup', {
'page-directive': {
pattern: /<%\s*@.*%>/i,
pattern: /<%\s*@.*%>/,
alias: 'tag',
inside: {
'page-directive': {
Expand All @@ -11,19 +11,19 @@ Prism.languages.aspnet = Prism.languages.extend('markup', {
}
},
'directive': {
pattern: /<%.*%>/i,
pattern: /<%.*%>/,
alias: 'tag',
inside: {
'directive': {
pattern: /<%\s*?[$=%#:]{0,2}|%>/i,
pattern: /<%\s*?[$=%#:]{0,2}|%>/,
alias: 'tag'
},
rest: Prism.languages.csharp
}
}
});
// Regexp copied from prism-markup, with a negative look-ahead added
Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i;
Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/;

// match directives of attribute value foo="<% Bar %>"
Prism.languages.insertBefore('inside', 'punctuation', {
Expand Down

0 comments on commit 3c61c8f

Please sign in to comment.