github-pages-deploy-action/node_modules/eslint/lib/rules/no-with.js

40 lines
863 B
JavaScript
Raw Normal View History

2020-03-07 11:45:40 +08:00
/**
* @fileoverview Rule to flag use of with statement
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow `with` statements",
category: "Best Practices",
2020-03-31 20:40:00 +08:00
recommended: true,
2020-03-07 11:45:40 +08:00
url: "https://eslint.org/docs/rules/no-with"
},
2020-05-15 05:33:08 +08:00
schema: [],
messages: {
unexpectedWith: "Unexpected use of 'with' statement."
}
2020-03-07 11:45:40 +08:00
},
create(context) {
return {
WithStatement(node) {
2020-05-15 05:33:08 +08:00
context.report({ node, messageId: "unexpectedWith" });
2020-03-07 11:45:40 +08:00
}
};
}
};