2024-02-05 09:26:37 +00:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright 2024 Google Inc.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2020-07-13 09:22:26 +00:00
|
|
|
module.exports = {
|
|
|
|
rules: {
|
|
|
|
'no-restricted-imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
/** The mocha tests run on the compiled output in the /lib directory
|
|
|
|
* so we should avoid importing from src.
|
|
|
|
*/
|
|
|
|
patterns: ['*src*'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2023-05-11 13:10:27 +00:00
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['*.spec.ts'],
|
|
|
|
rules: {
|
2023-07-17 08:52:54 +00:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'error',
|
|
|
|
{argsIgnorePattern: '^_', varsIgnorePattern: '^_'},
|
|
|
|
],
|
2023-05-11 13:10:27 +00:00
|
|
|
'no-restricted-syntax': [
|
2023-06-12 08:44:18 +00:00
|
|
|
'error',
|
2023-05-11 13:10:27 +00:00
|
|
|
{
|
|
|
|
message:
|
|
|
|
'Use helper command `launch` to make sure the browsers get cleaned',
|
|
|
|
selector:
|
|
|
|
'MemberExpression[object.name="puppeteer"][property.name="launch"]',
|
|
|
|
},
|
2023-10-11 17:21:50 +00:00
|
|
|
{
|
|
|
|
message: 'Unexpected debugging mocha test.',
|
|
|
|
selector:
|
|
|
|
'CallExpression[callee.object.name="it"] > MemberExpression > Identifier[name="deflake"], CallExpression[callee.object.name="it"] > MemberExpression > Identifier[name="deflakeOnly"]',
|
|
|
|
},
|
2024-03-19 19:29:42 +00:00
|
|
|
{
|
|
|
|
message:
|
|
|
|
'No `expect` in EventHandler. They will never throw errors',
|
|
|
|
selector:
|
|
|
|
'CallExpression[callee.property.name="on"] BlockStatement > :not(TryStatement) > ExpressionStatement > CallExpression[callee.object.callee.name="expect"]',
|
|
|
|
},
|
2023-05-11 13:10:27 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2020-07-13 09:22:26 +00:00
|
|
|
};
|