eslint-plugin-ember-template-lint 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ const templateLintConfig = {
4
4
  };
5
5
 
6
6
  function registerRule(name, config) {
7
- templateLintConfig.rules[name] = config;
7
+ templateLintConfig.rules[name] = Array.isArray(config) ? config[0] : config;
8
8
  }
9
9
 
10
10
  function registerPlugin(name) {
@@ -63,7 +63,7 @@ async function _applyFixes(options, results, columnOffset) {
63
63
  }
64
64
  const diffs = generateDifferences(template, code);
65
65
  diffs.forEach((d) => {
66
- d.range = [d.offset, d.offset + (d.deleteText?.length || 0)];
66
+ d.range = [d.offset - columnOffset, d.offset + (d.deleteText?.length || 0) - columnOffset];
67
67
  });
68
68
  fixableIssues.filter(r => r.rule === ruleName).forEach((r) => {
69
69
  const range = r.range;
package/lib/rules/lint.js CHANGED
@@ -27,8 +27,6 @@ function runTemplateLint(node, context) {
27
27
  lintMessages.forEach((m) => {
28
28
  if (m.fix) {
29
29
  m.fix.forEach((fix) => {
30
- const d = fix;
31
- fix.range = [d.offset, d.offset + (d.deleteText?.length || 0)];
32
30
  const start = originalDocument.offsetToPosition(fix.range[0]);
33
31
  const end = originalDocument.offsetToPosition(fix.range[1]);
34
32
  fix.range = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-ember-template-lint",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Provide linting for ember template",
5
5
  "keywords": [
6
6
  "eslint",