hogehoge
hogehoge
- npm
npm i -D eslint-plugin-export-restrict- pnpm
pnpm i -D eslint-plugin-export-restrictDepending on how you configure ESLint, use either Flat Config or eslintrc to configure eslint-plugin-export-restrict.
import exportRestrictPlugin from "eslint-plugin-export-restrict";
export default [
// other settings...
{
plugins: {
"export-restrict": exportRestrictPlugin,
},
},
{
rules: {
"export-restrict/no-export-private-declares": ["error"],
},
},
];{
"plugins": [
"export-restrict",
],
"rules": {
"export-restrict/no-export-private-declares": ["error"],
}
}// --------- good ---------
/** @private */
function func1() {}
/** @private */
function func2() {}
// --------- bad ----------
/** @private */
function func1() {}
/** @private */
export function func2() {}
export {
func1
}Welcome
MIT