mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
add custom rule to prevent test.only
This commit is contained in:
17
build/lib/eslint/code-no-test-only.js
Normal file
17
build/lib/eslint/code-no-test-only.js
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
module.exports = new class NoTestOnly {
|
||||
create(context) {
|
||||
return {
|
||||
['MemberExpression[object.name="test"][property.name="only"]']: (node) => {
|
||||
return context.report({
|
||||
node,
|
||||
message: 'test.only is a dev-time tool and CANNOT be pushed'
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user