Skip to content

Commit

Permalink
add no-imports-from-entries rules
Browse files Browse the repository at this point in the history
(cherry picked from commit efba6ab)
  • Loading branch information
OlgaLarina committed Jul 11, 2024
1 parent e0fd30d commit a79d394
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"rules": {
"surveyjs/no-test-only": 2,
"surveyjs/no-test-debug": 2,
"surveyjs/no-imports-from-entries": 2,
"no-console": 2, // Remember, this means error!
"indent": [
"error",
Expand Down
9 changes: 9 additions & 0 deletions eslint-surveyjs/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const testOnlyMessage = " :( please don't forget to remove 'test.only' testcafe statement it will disable all other tests :( ";
const debugMessage = " :( please don't forget to remove 'debug()' :( ";
const entriesMessage = "import from 'entries' folder needs to be replaced. Use another path."

module.exports = {
rules: {
Expand All @@ -23,5 +24,13 @@ module.exports = {
}
}
}),
"no-imports-from-entries": context =>
({
ImportDeclaration: function (node) {
if (node.source.value.includes("\/entries\/")) {
context.report(node, entriesMessage);
}
}
}),
}
};

0 comments on commit a79d394

Please sign in to comment.