@discourse/lint-configs 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,12 +27,12 @@ export default {
27
27
  }
28
28
 
29
29
  if (
30
- node.source.value.toLowerCase() === "discourse-common/helpers/i18n"
30
+ node.source.value.toLowerCase() === "discourse-common/helpers/i18n" ||
31
+ node.source.value.toLowerCase() === "discourse/helpers/i18n"
31
32
  ) {
32
33
  context.report({
33
34
  node,
34
- message:
35
- "Import from 'discourse-common/helpers/i18n' is not allowed. Use 'discourse-i18n' instead.",
35
+ message: `Import from '${node.source.value}' is not allowed. Use 'discourse-i18n' instead.`,
36
36
  fix(fixer) {
37
37
  const existingImport = context
38
38
  .getSourceCode()
package/eslint.mjs CHANGED
@@ -7,6 +7,7 @@ import EmberESLintParser from "ember-eslint-parser";
7
7
  import DecoratorPosition from "eslint-plugin-decorator-position";
8
8
  import EmberPlugin from "eslint-plugin-ember";
9
9
  import EmberRecommended from "eslint-plugin-ember/configs/recommended";
10
+ import ImportPlugin from "eslint-plugin-import";
10
11
  import QUnitPlugin from "eslint-plugin-qunit";
11
12
  import QUnitRecommended from "eslint-plugin-qunit/configs/recommended";
12
13
  import SimpleImportSort from "eslint-plugin-simple-import-sort";
@@ -101,6 +102,7 @@ export default [
101
102
  "decorator-position": DecoratorPosition,
102
103
  "simple-import-sort": SimpleImportSort,
103
104
  qunit: QUnitPlugin,
105
+ import: ImportPlugin,
104
106
  discourse: {
105
107
  rules: {
106
108
  "i18n-import-location": i18nImport,
@@ -156,7 +158,7 @@ export default [
156
158
  "valid-typeof": "error",
157
159
  "wrap-iife": ["error", "inside"],
158
160
  curly: "error",
159
- "no-duplicate-imports": "error",
161
+ "import/no-duplicates": "error",
160
162
  "object-shorthand": ["error", "properties"],
161
163
  "no-dupe-class-members": "error",
162
164
  "@stylistic/js/lines-between-class-members": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@discourse/lint-configs",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Shareable lint configs for Discourse core, plugins, and themes",
5
5
  "author": "Discourse",
6
6
  "license": "MIT",
@@ -38,6 +38,7 @@
38
38
  "eslint": "^9.21.0",
39
39
  "eslint-plugin-decorator-position": "^6.0.0",
40
40
  "eslint-plugin-ember": "^12.5.0",
41
+ "eslint-plugin-import": "^2.31.0",
41
42
  "eslint-plugin-qunit": "^8.1.2",
42
43
  "eslint-plugin-simple-import-sort": "^12.1.1",
43
44
  "eslint-plugin-sort-class-members": "^1.21.0",