mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-30 19:40:32 -04:00
add regex optimization eslint
This commit is contained in:
parent
e22668640e
commit
8ae4cd7046
@ -8,7 +8,7 @@
|
|||||||
"project": "./tsconfig.json" // <-- Point to your project's "tsconfig.json" or create a new one.
|
"project": "./tsconfig.json" // <-- Point to your project's "tsconfig.json" or create a new one.
|
||||||
},
|
},
|
||||||
|
|
||||||
"plugins": ["unused-imports"],
|
"plugins": ["unused-imports", "optimize-regex"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts"],
|
"files": ["*.ts"],
|
||||||
@ -48,7 +48,8 @@
|
|||||||
"args": "after-used",
|
"args": "after-used",
|
||||||
"argsIgnorePattern": "^_"
|
"argsIgnorePattern": "^_"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"optimize-regex/optimize-regex": "warn"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -177,7 +177,6 @@
|
|||||||
"schematicCollections": [
|
"schematicCollections": [
|
||||||
"@cypress/schematic",
|
"@cypress/schematic",
|
||||||
"@angular-eslint/schematics",
|
"@angular-eslint/schematics",
|
||||||
"@angular-eslint/schematics",
|
|
||||||
"@schematics/angular"
|
"@schematics/angular"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
22
src/package-lock.json
generated
22
src/package-lock.json
generated
@ -54,6 +54,7 @@
|
|||||||
"cypress": "latest",
|
"cypress": "latest",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-deprecation": "^2.0.0",
|
"eslint-plugin-deprecation": "^2.0.0",
|
||||||
|
"eslint-plugin-optimize-regex": "^1.2.1",
|
||||||
"eslint-plugin-unused-imports": "^3.1.0",
|
"eslint-plugin-unused-imports": "^3.1.0",
|
||||||
"firebase-tools": "^13.4.0",
|
"firebase-tools": "^13.4.0",
|
||||||
"fuzzy": "^0.1.3",
|
"fuzzy": "^0.1.3",
|
||||||
@ -11980,6 +11981,18 @@
|
|||||||
"typescript": "^4.2.4 || ^5.0.0"
|
"typescript": "^4.2.4 || ^5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/eslint-plugin-optimize-regex": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-optimize-regex/-/eslint-plugin-optimize-regex-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-fUaU7Tj1G/KSTDTABJw4Wp427Rl7RPl9ViYTu1Jrv36fJw4DFhd4elPdXiuYtdPsNsvzn9GcVlKEssGIVjw0UQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"regexp-tree": "^0.1.21"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/eslint-plugin-unused-imports": {
|
"node_modules/eslint-plugin-unused-imports": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.1.0.tgz",
|
||||||
@ -21225,6 +21238,15 @@
|
|||||||
"integrity": "sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg==",
|
"integrity": "sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/regexp-tree": {
|
||||||
|
"version": "0.1.27",
|
||||||
|
"resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz",
|
||||||
|
"integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"regexp-tree": "bin/regexp-tree"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/regexpu-core": {
|
"node_modules/regexpu-core": {
|
||||||
"version": "5.3.2",
|
"version": "5.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz",
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
"cypress": "latest",
|
"cypress": "latest",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-deprecation": "^2.0.0",
|
"eslint-plugin-deprecation": "^2.0.0",
|
||||||
|
"eslint-plugin-optimize-regex": "^1.2.1",
|
||||||
"eslint-plugin-unused-imports": "^3.1.0",
|
"eslint-plugin-unused-imports": "^3.1.0",
|
||||||
"firebase-tools": "^13.4.0",
|
"firebase-tools": "^13.4.0",
|
||||||
"fuzzy": "^0.1.3",
|
"fuzzy": "^0.1.3",
|
||||||
|
@ -747,7 +747,7 @@ export class AppService extends createReducingService(initialState) {
|
|||||||
|
|
||||||
qry = qry.split('"').join(''); // remove any quotes, just in case
|
qry = qry.split('"').join(''); // remove any quotes, just in case
|
||||||
|
|
||||||
if (qry.search(/[0-9]/i) === -1) {
|
if (qry.search(/\d/i) === -1) {
|
||||||
// its a word
|
// its a word
|
||||||
for (const item of BibleReference.Books) {
|
for (const item of BibleReference.Books) {
|
||||||
if (
|
if (
|
||||||
@ -772,7 +772,7 @@ export class AppService extends createReducingService(initialState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.dispatch(updateAutoCompleteAction(words));
|
this.dispatch(updateAutoCompleteAction(words));
|
||||||
} else if (qry.search(/(H|G)[0-9]/i) !== -1) {
|
} else if (qry.search(/(h|g)\d/i) !== -1) {
|
||||||
// its a strongs lookup
|
// its a strongs lookup
|
||||||
if (qry.substring(0, 1).toUpperCase() === 'H') {
|
if (qry.substring(0, 1).toUpperCase() === 'H') {
|
||||||
const num = parseInt(qry.substring(1), 10);
|
const num = parseInt(qry.substring(1), 10);
|
||||||
@ -852,7 +852,7 @@ export class AppService extends createReducingService(initialState) {
|
|||||||
type: CardType.Note,
|
type: CardType.Note,
|
||||||
data,
|
data,
|
||||||
} as CardItem;
|
} as CardItem;
|
||||||
} else if (qry.search(/[0-9]/i) === -1) {
|
} else if (qry.search(/\d/i) === -1) {
|
||||||
// // its a search term.
|
// // its a search term.
|
||||||
const data = await this.getWordsFromApi(qry);
|
const data = await this.getWordsFromApi(qry);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
@ -863,7 +863,7 @@ export class AppService extends createReducingService(initialState) {
|
|||||||
type: CardType.Word,
|
type: CardType.Word,
|
||||||
data,
|
data,
|
||||||
} as CardItem;
|
} as CardItem;
|
||||||
} else if (qry.search(/(H|G)[0-9]/i) !== -1) {
|
} else if (qry.search(/(h|g)\d/i) !== -1) {
|
||||||
// its a strongs lookup
|
// its a strongs lookup
|
||||||
const dict = qry.substring(0, 1).search(/h/i) !== -1 ? 'heb' : 'grk';
|
const dict = qry.substring(0, 1).search(/h/i) !== -1 ? 'heb' : 'grk';
|
||||||
const strongsNumber = qry.substring(1, qry.length);
|
const strongsNumber = qry.substring(1, qry.length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user