Skip to content

Commit

Permalink
Revert "test(estlint): Fix .project.eslintrc.js"
Browse files Browse the repository at this point in the history
This reverts commit 0f80eca.
  • Loading branch information
tiberiuichim committed Nov 16, 2022
1 parent a09a728 commit 59bcb8e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .project.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ const projectRootPath = fs.existsSync('./project')
? fs.realpathSync('./project')
: fs.realpathSync('./../../../');
const packageJson = require(path.join(projectRootPath, 'package.json'));
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json'))
.compilerOptions;

const pathsConfig = jsConfig.paths;

let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');

Object.keys(pathsConfig).forEach(pkg => {
Object.keys(pathsConfig).forEach((pkg) => {
if (pkg === '@plone/volto') {
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
}
Expand All @@ -20,11 +21,15 @@ const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
const reg = new AddonConfigurationRegistry(projectRootPath);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(reg.packages).map(o => [
const addonAliases = Object.keys(reg.packages).map((o) => [
o,
reg.packages[o].modulePath,
]);

const voltoSearchlibPath = path.dirname(
reg.packages['@eeacms/volto-searchlib'].modulePath,
);
const searchlibPath = path.resolve(`${voltoSearchlibPath}/searchlib`);

module.exports = {
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
Expand All @@ -34,6 +39,7 @@ module.exports = {
map: [
['@plone/volto', '@plone/volto/src'],
...addonAliases,
['@eeacms/search', searchlibPath],
['@package', `${__dirname}/src`],
['~', `${__dirname}/src`],
],
Expand All @@ -45,4 +51,3 @@ module.exports = {
},
},
};

0 comments on commit 59bcb8e

Please sign in to comment.