Skip to content

Commit

Permalink
add lint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed May 11, 2024
1 parent d2d1928 commit c263c85
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ module.exports = {
'lexical/no-optional-chaining': OFF,
},
},
{
files: [
'packages/*/src/index.ts',
'packages/*/src/index.tsx',
'packages/lexical-react/src/*.ts',
'packages/lexical-react/src/*.tsx',
],
rules: {
'no-restricted-exports': [
'error',
{
restrictDefaultExports: {
defaultFrom: true,
direct: true,
named: true,
namedFrom: true,
namespaceFrom: true,
},
},
],
},
},
],

parser: '@babel/eslint-parser',
Expand Down
1 change: 1 addition & 0 deletions packages/lexical-eslint-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
import * as plugin from './LexicalEslintPlugin.js';

export type {RulesOfLexicalOptions} from './rules/rules-of-lexical.js';
// eslint-disable-next-line no-restricted-exports
export default plugin;
1 change: 1 addition & 0 deletions packages/lexical-react/src/LexicalClickableLinkPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ export function ClickableLinkPlugin({
}

/** @deprecated use the named export {@link ClickableLinkPlugin} */
// eslint-disable-next-line no-restricted-exports
export default ClickableLinkPlugin;
1 change: 1 addition & 0 deletions packages/lexical-react/src/LexicalErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ export function LexicalErrorBoundary({
}

/** @deprecated use the named export {@link LexicalErrorBoundary} */
// eslint-disable-next-line no-restricted-exports
export default LexicalErrorBoundary;
1 change: 1 addition & 0 deletions packages/lexical-react/src/LexicalTableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,5 @@ export function LexicalTableOfContents({children}: Props): JSX.Element {
}

/** @deprecated use the named export {@link LexicalTableOfContents} */
// eslint-disable-next-line no-restricted-exports
export default LexicalTableOfContents;
1 change: 1 addition & 0 deletions packages/lexical-react/src/useLexicalEditable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export function useLexicalEditable(): boolean {
}

/** @deprecated use the named export {@link useLexicalEditable} */
// eslint-disable-next-line no-restricted-exports
export default useLexicalEditable;
1 change: 1 addition & 0 deletions packages/lexical-react/src/useLexicalSubscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ export function useLexicalSubscription<T>(
}

/** @deprecated use the named export {@link useLexicalSubscription} */
// eslint-disable-next-line no-restricted-exports
export default useLexicalSubscription;

0 comments on commit c263c85

Please sign in to comment.