Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import nodePlugin from 'eslint-plugin-n';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import pluginJs from '@eslint/js';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);
const noBarrelImports = require('./eslint/rules/no-barrel-imports.js');

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down Expand Up @@ -41,6 +45,11 @@ export default [
plugins: {
'ember-internal': emberInternal,
'disable-features': disableFeatures,
local: {
rules: {
'no-barrel-imports': noBarrelImports,
},
},
},

linterOptions: {
Expand Down Expand Up @@ -78,6 +87,11 @@ export default [
'disable-features/disable-generator-functions': 'error',
// Doesn't work with package.json#exports
'import/no-unresolved': 'off',

// Prevent importing from barrel/entrypoint files in internal packages.
// Source files should import directly from the specific lib/ file to
// enable proper tree-shaking.
'local/no-barrel-imports': 'error',
},
},
...tseslint.configs.recommended.map((config) => ({
Expand Down
Loading
Loading