Skip to content

Commit

Permalink
Enable the import/no-restricted-paths ESLint plugin rule for the vi…
Browse files Browse the repository at this point in the history
…ewer

Code in the `web/` folder cannot import directly from the `src/` folder, since that could result in most (or all) main-thread code being bundled into the viewer, and must rather be imported via the `pdfjs-lib` alias.

Let's use ESLint to help enforce this, please find additional details in https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md
  • Loading branch information
Snuffleupagus committed Jan 20, 2025
1 parent 01d542e commit d91830c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ export default [
"import/no-empty-named-blocks": "error",
"import/no-commonjs": "error",
"import/no-mutable-exports": "error",
"import/no-restricted-paths": [
"error",
{
zones: [
{
target: "./web",
from: "./src",
},
],
},
],
"import/no-self-import": "error",
"import/no-unresolved": [
"error",
Expand Down

0 comments on commit d91830c

Please sign in to comment.