mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Enterprise Search] eslint rule override: catch unnecessary backticks (#90347)
* Add eslint rule for linting unnecessary backticks This needs to be below the Prettier overrides at the bottom of the file to override Prettier * Run --fix Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
70d61436bc
commit
0c0a74b364
6 changed files with 24 additions and 12 deletions
12
.eslintrc.js
12
.eslintrc.js
|
@ -1112,6 +1112,8 @@ module.exports = {
|
|||
|
||||
/**
|
||||
* Enterprise Search overrides
|
||||
* NOTE: We also have a single rule at the bottom of the file that
|
||||
* overrides Prettier's default of not linting unnecessary backticks
|
||||
*/
|
||||
{
|
||||
// All files
|
||||
|
@ -1268,6 +1270,16 @@ module.exports = {
|
|||
...require('eslint-config-prettier/@typescript-eslint').rules,
|
||||
},
|
||||
},
|
||||
/**
|
||||
* Enterprise Search Prettier override
|
||||
* Lints unnecessary backticks - @see https://github.com/prettier/eslint-config-prettier/blob/main/README.md#forbid-unnecessary-backticks
|
||||
*/
|
||||
{
|
||||
files: ['x-pack/plugins/enterprise_search/**/*.{ts,tsx}'],
|
||||
rules: {
|
||||
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
files: [
|
||||
|
|
|
@ -62,7 +62,7 @@ describe('DocumentDetailLogic', () => {
|
|||
|
||||
DocumentDetailLogic.actions.getDocumentDetails('1');
|
||||
|
||||
expect(http.get).toHaveBeenCalledWith(`/api/app_search/engines/engine1/documents/1`);
|
||||
expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/engine1/documents/1');
|
||||
await nextTick();
|
||||
expect(DocumentDetailLogic.actions.setFields).toHaveBeenCalledWith(fields);
|
||||
});
|
||||
|
@ -96,7 +96,7 @@ describe('DocumentDetailLogic', () => {
|
|||
mount();
|
||||
DocumentDetailLogic.actions.deleteDocument('1');
|
||||
|
||||
expect(http.delete).toHaveBeenCalledWith(`/api/app_search/engines/engine1/documents/1`);
|
||||
expect(http.delete).toHaveBeenCalledWith('/api/app_search/engines/engine1/documents/1');
|
||||
await nextTick();
|
||||
expect(setQueuedSuccessMessage).toHaveBeenCalledWith(
|
||||
'Successfully marked document for deletion. It will be deleted momentarily.'
|
||||
|
|
|
@ -53,7 +53,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({ product, image }) => {
|
|||
className="productCard"
|
||||
titleElement="h2"
|
||||
title={i18n.translate('xpack.enterpriseSearch.overview.productCard.heading', {
|
||||
defaultMessage: `Elastic {productName}`,
|
||||
defaultMessage: 'Elastic {productName}',
|
||||
values: { productName: product.NAME },
|
||||
})}
|
||||
image={
|
||||
|
|
|
@ -26,7 +26,7 @@ export function registerDocumentsRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:engineName/documents/new`,
|
||||
path: '/as/engines/:engineName/documents/new',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ export function registerDocumentRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:engineName/documents/:documentId`,
|
||||
path: '/as/engines/:engineName/documents/:documentId',
|
||||
})
|
||||
);
|
||||
router.delete(
|
||||
|
@ -60,7 +60,7 @@ export function registerDocumentRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:engineName/documents/:documentId`,
|
||||
path: '/as/engines/:engineName/documents/:documentId',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ export function registerEnginesRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:name/details`,
|
||||
path: '/as/engines/:name/details',
|
||||
})
|
||||
);
|
||||
router.get(
|
||||
|
@ -69,7 +69,7 @@ export function registerEnginesRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:name/overview_metrics`,
|
||||
path: '/as/engines/:name/overview_metrics',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ export function registerSearchSettingsRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:engineName/search_settings/details`,
|
||||
path: '/as/engines/:engineName/search_settings/details',
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -52,7 +52,7 @@ export function registerSearchSettingsRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:engineName/search_settings/reset`,
|
||||
path: '/as/engines/:engineName/search_settings/reset',
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -67,7 +67,7 @@ export function registerSearchSettingsRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:engineName/search_settings`,
|
||||
path: '/as/engines/:engineName/search_settings',
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -88,7 +88,7 @@ export function registerSearchSettingsRoutes({
|
|||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
path: `/as/engines/:engineName/search_settings_search`,
|
||||
path: '/as/engines/:engineName/search_settings_search',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue