Skip to content

Commit

Permalink
fix(deps): configure and fix new ESLint rules from @jenssimon/eslint-…
Browse files Browse the repository at this point in the history
…config-base
  • Loading branch information
jenssimon committed Aug 3, 2022
1 parent d69f09a commit 56219fc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getModulePath = (moduleName, basePath, cartridge, target) => {
path.dirname(moduleName),
`${basePath}/${cartridge}${target}`,
);
return (relPath.indexOf('.') === -1 ? './' : '') + relPath;
return (!relPath.includes('.') ? './' : '') + relPath;
};

module.exports = (babel, { cartridgePath, basePath }) => ({
Expand All @@ -26,7 +26,7 @@ module.exports = (babel, { cartridgePath, basePath }) => ({
* @param findCartridge a function to find the cartridge
*/
const resolve = (findCartridge) => {
const target = imp.source.substring(1);
const target = imp.source.slice(1);
const foundCartridge = findCartridge(target);
if (foundCartridge) {
imp.source = getModulePath(state.file.opts.filename, basePath, foundCartridge, target);
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"semantic-release": "19.0.3"
},
"dependencies": {
"@babel/types": "^7.17.0",
"@babel/types": "^7.18.10",
"imports-visitor": "^2.0.0"
},
"files": [
Expand All @@ -61,7 +61,10 @@
"eslintConfig": {
"extends": [
"@jenssimon/base"
]
],
"rules": {
"unicorn/prefer-module": "off"
}
},
"packageManager": "yarn@3.2.2",
"config": {
Expand Down
6 changes: 5 additions & 1 deletion test/cartridges/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"root": true,
"extends": [
"@jenssimon/sfcc"
]
],
"rules": {
"unicorn/prefer-module": "off",
"unicorn/prefer-spread": "off"
}
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,7 @@ __metadata:
dependencies:
"@babel/core": 7.18.10
"@babel/eslint-parser": 7.18.9
"@babel/types": ^7.17.0
"@babel/types": ^7.18.10
"@commitlint/cli": 17.0.3
"@commitlint/config-conventional": 17.0.3
"@jenssimon/eslint-config-base": 6.0.0
Expand Down

0 comments on commit 56219fc

Please sign in to comment.