mirror of
https://github.com/hanzoai/eslint.git
synced 2026-10-30 19:38:10 +00:00
* drop support for function-style rules in flat-rule-tester * drop support for function-style rules in rule-tester * drop support for function-style rules in config-rule (eslint-fuzzer) * add rule object checks to rule testers * drop support for function-style rules in flat config and Linter#defineRule * update JSDoc * add rule object checks to Linter * drop support for function-style rules in eslintrc * remove custom-rules-deprecated.md * update flat config getRuleOptionsSchema for schema changes * add back and update custom-rules-deprecated.md * show ruleId in error messages for invalid schema * throw error in Linter if rule has invalid schema * add short description of meta.schema to type errors in flat-rule-tester * throw error for empty object schema in flat-rule-tester * update rule-tester for schema changes * add integration tests for eslintrc schema changes * add more flat-config-array unit tests for schema changes * throw error in Linter in eslintrc mode if rule has invalid schema * update docs for schema changes * use eslintrc v3
23 lines
621 B
Plaintext
23 lines
621 B
Plaintext
module.exports = {
|
|
rules: {
|
|
rule1: {
|
|
meta: {
|
|
schema: false
|
|
},
|
|
create(context) {
|
|
return {
|
|
Program(node) {
|
|
const [option] = context.options;
|
|
|
|
if (option) {
|
|
context.report({ node, message: `Option '${option}' was passed` });
|
|
} else {
|
|
context.report({ node, message: `No options were passed` });
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|
|
},
|
|
};
|