mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 06:38:07 +02:00
Lint against export [some declaration]
This disallowd the following types of `export` declaration: - `export class A {}`/`export function A() {}` - `export default class A {}`/`export default function A() {}` - `export let A`/`export const A`/`export var A` While allowing - `export { A }` - `export default A`
This commit is contained in:
parent
72feb4c256
commit
f654fb1b83
2 changed files with 11 additions and 0 deletions
|
@ -306,6 +306,16 @@ export default [
|
|||
selector: "NewExpression[callee.name='Ref']",
|
||||
message: "Use `Ref.get()` rather than `new Ref()`.",
|
||||
},
|
||||
{
|
||||
selector: "ExportNamedDeclaration[declaration]",
|
||||
message:
|
||||
"Separate the declaration and the export statement, using `export { ... }`.",
|
||||
},
|
||||
{
|
||||
selector: "ExportDefaultDeclaration:has(> :declaration)",
|
||||
message:
|
||||
"Separate the declaration and the export statement, using `export default <variable name>`.",
|
||||
},
|
||||
],
|
||||
"no-unneeded-ternary": "error",
|
||||
"operator-assignment": "error",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue