Skip to content

Commit

Permalink
Merge branch 'master' into test-line-ends
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Jun 13, 2021
2 parents 97ed806 + 8e93c5d commit 6f540bf
Show file tree
Hide file tree
Showing 208 changed files with 785 additions and 314 deletions.
31 changes: 29 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
plugins: ['jsdoc'],
plugins: ['jsdoc', 'regexp'],
extends: 'eslint:recommended',
rules: {
'no-use-before-define': ['error', { 'functions': false, 'classes': false }],
Expand Down Expand Up @@ -55,6 +55,29 @@ module.exports = {
'jsdoc/require-param-name': 'warn',
'jsdoc/require-property-name': 'warn',

// regexp
'regexp/no-assertion-capturing-group': 'error',
// 'regexp/no-dupe-disjunctions': 'error',
'regexp/no-empty-alternative': 'error',
'regexp/no-empty-lookarounds-assertion': 'error',
'regexp/no-lazy-ends': 'error',
'regexp/no-obscure-range': 'error',
'regexp/no-optional-assertion': 'error',
'regexp/no-standalone-backslash': 'error',
'regexp/no-zero-quantifier': 'error',
'regexp/optimal-lookaround-quantifier': 'error',
'regexp/no-unused-capturing-group': 'error',

'regexp/match-any': 'warn',
'regexp/negation': 'warn',
'regexp/no-dupe-characters-character-class': 'warn',
'regexp/no-trivially-nested-assertion': 'warn',
'regexp/no-trivially-nested-quantifier': 'warn',
'regexp/no-useless-character-class': 'warn',
'regexp/no-useless-lazy': 'warn',
'regexp/prefer-w': 'warn',
'regexp/sort-flags': 'warn',

// I turned this rule off because we use `hasOwnProperty` in a lot of places
// TODO: Think about re-enabling this rule
'no-prototype-builtins': 'off',
Expand All @@ -70,7 +93,11 @@ module.exports = {
'no-useless-escape': 'off'
},
settings: {
jsdoc: { mode: 'typescript' }
jsdoc: { mode: 'typescript' },
regexp: {
// allow alphanumeric and cyrillic ranges
allowedCharacterRanges: ['alphanumeric', 'а-я', 'А-Я']
}
},
ignorePatterns: [
'*.min.js',
Expand Down
4 changes: 2 additions & 2 deletions components/prism-abnf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
alias: 'operator'
},
'definition': {
pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^>\r\n]*>)(?=\s*=)/m,
pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m,
lookbehind: true,
alias: 'keyword',
inside: {
Expand All @@ -41,7 +41,7 @@
}
},
'rule': {
pattern: /(^|[^<\w-])[a-z][\w-]*|<[^>\r\n]*>/i,
pattern: /(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i,
lookbehind: true,
inside: {
'punctuation': /<|>/
Expand Down
2 changes: 1 addition & 1 deletion components/prism-abnf.min.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-ada.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Prism.languages.ada = {
'operator': /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,
'punctuation': /\.\.?|[,;():]/,
'char': /'.'/,
'variable': /\b[a-z](?:[_a-z\d])*\b/i
'variable': /\b[a-z](?:\w)*\b/i
};
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.

0 comments on commit 6f540bf

Please sign in to comment.