Skip to content

Commit 7aaa354

Browse files
committed
Improve resilience of ESlint config. Improve TSconfig to recognize volto-light-theme package correctly.
1 parent 5836779 commit 7aaa354

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.eslintrc.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@ module.exports = {
2020
extends: `${coreLocation}/packages/volto/.eslintrc`,
2121
rules: {
2222
'import/no-unresolved': 1,
23+
'import/named': 'error',
24+
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
25+
'no-restricted-imports': [
26+
'error',
27+
{
28+
name: '@plone/volto/components',
29+
message:
30+
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
31+
},
32+
{
33+
name: '@plone/volto/helpers',
34+
message:
35+
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
36+
},
37+
{
38+
name: '@plone/volto/actions',
39+
message:
40+
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
41+
},
42+
],
43+
'react/jsx-key': [2, { checkFragmentShorthand: true }],
2344
},
2445
settings: {
2546
'import/resolver': {
@@ -28,7 +49,14 @@ module.exports = {
2849
['@plone/volto', `${coreLocation}/packages/volto/src`],
2950
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`],
3051
['@plone/registry', `${coreLocation}/packages/registry/src`],
31-
['@kitconcept/volto-logos-block', './packages/volto-logos-block/src'],
52+
[
53+
'@kitconcept/volto-light-theme',
54+
`${projectRootPath}/../volto-light-theme/frontend/packages/volto-light-theme/src`,
55+
],
56+
[
57+
'@kitconcept/volto-logos-block',
58+
`${projectRootPath}/packages/volto-logos-block/src`,
59+
],
3260
...addonAliases,
3361
],
3462
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],

packages/volto-logos-block/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"release-alpha": "release-it --preRelease=alpha"
2828
},
2929
"dependencies": {
30-
"@plone/components": "workspace:*"
30+
"@plone/components": "workspace:*",
31+
"@kitconcept/volto-light-theme": "workspace:*"
3132
},
3233
"peerDependencies": {
3334
"classnames": "2.5.1",

packages/volto-logos-block/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
"jsx": "react-jsx",
1515
"paths": {
1616
"@plone/volto/*": ["../../core/packages/volto/src/*"],
17+
"@kitconcept/volto-light-theme/*": [
18+
"./node_modules/@kitconcept/volto-light-theme/src/*"
19+
],
1720
"@kitconcept/volto-logos-block/*": ["./src/*"]
1821
}
1922
},
20-
"include": ["**/*.ts", "**/*.tsx","**/*.js", "**/*.jsx"],
23+
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
2124
"exclude": [
2225
"node_modules",
2326
"build",

0 commit comments

Comments
 (0)