eslint-plugin-qwik 0.0.18-6 → 0.0.18-dev123

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.
package/README.md CHANGED
@@ -1 +1 @@
1
- # eslint-plugin-qwik
1
+ # eslint-plugin-qwik
package/index.js CHANGED
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.rules = void 0;
3
+ exports.configs = exports.rules = void 0;
4
4
  var noPropsDestructuting_1 = require("./lib/noPropsDestructuting");
5
5
  var noUseAfterAwait_1 = require("./lib/noUseAfterAwait");
6
6
  exports.rules = {
7
7
  'no-props-destructuring': noPropsDestructuting_1.noPropsDestructuring,
8
8
  'no-use-after-await': noUseAfterAwait_1.noUseAfterAwait
9
9
  };
10
+ exports.configs = {
11
+ recommended: {
12
+ plugins: ['qwik'],
13
+ rules: {
14
+ 'qwik/no-props-destructuring': 'error',
15
+ 'qwik/no-use-after-await': 'error'
16
+ }
17
+ }
18
+ };
@@ -23,7 +23,7 @@ exports.noPropsDestructuring = {
23
23
  return {
24
24
  "CallExpression[callee.name='component$'][arguments.0.params.0.type='ObjectPattern']": function (node) {
25
25
  context.report({
26
- node: node,
26
+ node: node.arguments[0].params[0],
27
27
  message: 'Props destructuring is not a good practice in Qwik'
28
28
  });
29
29
  }
@@ -30,11 +30,13 @@ exports.noUseAfterAwait = {
30
30
  },
31
31
  AwaitExpression: function () {
32
32
  var last = stack[stack.length - 1];
33
- last.await = true;
33
+ if (last) {
34
+ last.await = true;
35
+ }
34
36
  },
35
37
  'CallExpression[callee.name=/^use/]': function (node) {
36
38
  var last = stack[stack.length - 1];
37
- if (last.await) {
39
+ if (last && last.await) {
38
40
  context.report({
39
41
  node: node,
40
42
  message: 'Calling use* methods after await is not safe.'
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "eslint-plugin-qwik",
3
- "version": "0.0.18-6",
3
+ "version": "0.0.18-dev123",
4
4
  "description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.",
5
- "main": "dist/index.js",
5
+ "main": "index.js",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "peerDependencies": {