diff --git a/.eslintrc.js b/.eslintrc.js index 1bbbfae..a069cfe 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -70,6 +70,17 @@ module.exports = { 'no-console': 'warn', 'no-null/no-null': 2, 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], + 'no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['shared/*', 'renderer/*', 'extension-host/*', 'node/*', 'client/*', 'main/*'], + message: `Importing from this path is not allowed. Try importing from @papi/core. Imports from paths like 'shared', 'renderer', 'node', 'client' and 'main' are not allowed to prevent unnecessary import break.`, + }, + ], + }, + ], 'prettier/prettier': ['warn', { tabWidth: 2, trailingComma: 'all' }], 'react/jsx-indent-props': ['warn', 2], 'react/jsx-props-no-spreading': ['error', { custom: 'ignore' }], @@ -81,7 +92,7 @@ module.exports = { // #region Overrides from paranext-core extension .eslintrc.cjs - 'import/no-unresolved': ['error', { ignore: ['papi'] }], + 'import/no-unresolved': ['error', { ignore: ['@papi'] }], // #endregion }, diff --git a/src/main.ts b/src/main.ts index 5b24402..08b5a55 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { logger } from 'papi-backend'; +import { logger } from '@papi/backend'; export async function activate() { logger.info('Extension template is activating!'); diff --git a/webpack/webpack.config.base.ts b/webpack/webpack.config.base.ts index 3e4e06a..b1de943 100644 --- a/webpack/webpack.config.base.ts +++ b/webpack/webpack.config.base.ts @@ -43,9 +43,10 @@ const configBase: webpack.Configuration = { 'react/jsx-runtime', 'react-dom', 'react-dom/client', - 'papi-frontend', - 'papi-frontend/react', - 'papi-backend', + '@papi/backend', + '@papi/core', + '@papi/frontend', + '@papi/frontend/react', '@sillsdev/scripture', ], module: {