eslint-plugin-omega-methods
v1.0.1
Published
eslint-plugin-omega-methods
Readme
eslint-plugin-omega-methods
1、使用说明
$ npm install eslint-plugin-omega-methods --save-dev2、配置 ESLint
在项目的 .eslintrc.js 或 .eslintrc.json 中:
module.exports = {
plugins: ["omega-methods"],
rules: {
"omega-methods/omega-method-prefix": "error",
},
};3、支持的导出模式
- export const/let 导出的函数
// 正确
export const $omegaMyFunction = () => {};
export let $omegaAnotherFunction = function() {};
// 错误
export const myFunction = () => {};
export let anotherFunction = function() {};- export {} 导出的函数
function $omegaCorrectFunction() {}
function incorrectFunction() {}
// 正确
export { $omegaCorrectFunction };
// 错误
export { incorrectFunction };- export default 导出的函数
// 正确
export default function $omegaDefaultFunction() {}
// 错误
export default function defaultFunction() {}