Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs report #3

Closed
namnm opened this issue Aug 12, 2021 · 7 comments
Closed

Bugs report #3

namnm opened this issue Aug 12, 2021 · 7 comments

Comments

@namnm
Copy link
Owner

namnm commented Aug 12, 2021

@hawtim please move to this thread, thanks

@hawtim
Copy link

hawtim commented Aug 12, 2021

@namnm I found an error when i did not use the rule in overrides, could you help me again.

just like this below.

rules: {
    // override/add rules settings
    // ...
    'sort-keys/sort-keys-fix': 'warn',
  },
  // overrides: [
  //   {
  //     files: [
  //       'src/store/index.js',
  //       'src/views/xSchemas.js',
  //       'src/views/xViews.js',
  //     ],
  //     rules: {

  //     },
  //   },
  // ],

image

@namnm
Copy link
Owner Author

namnm commented Aug 12, 2021

@hawtim Can you check if:

  • The plugin is at latest 2.3.4 (I did add some fixes for bugs in case of moving comments)
  • Do you know which file in your code it throw this error? I hope we can have something similar to the playground you made so I can examine and fix the bug if any.

@hawtim
Copy link

hawtim commented Aug 12, 2021

yes, it is 2.3.4 in my package-lock.json

"eslint-plugin-sort-keys": {
  "version": "2.3.4",
  "integrity": "sha512-jL9k4dTeHLqcgC7wX2FA7YTCWkpNirP2YMyyxQznuyIN58vSMUXWdBqnH2KSX/3y6ueV0t6gXuElSJeVqYszbg==",
  "dev": true,
  "requires": {
    "natural-compare": "1.4.0"
  }
},

I will try to make this error occur in my playground later

@hawtim
Copy link

hawtim commented Aug 12, 2021

I am guessing is it the plugin break this rule somehow.
image

@hawtim
Copy link

hawtim commented Aug 12, 2021

@namnm I found the code cause the error, is the inline comment.

const apiForModule = {
  packToList: {
    receiverList: 'dc/pack/receiver/get', // export page, receiver list
    exportToList: 'pack/export', // export page, export api
    transportOrderCreate: 'create', // to list page, create transport order
    transportOrderDetail: 'fleet/order/search', // toScan page, transport order detail
    transportOrderPrintDetail: 'print/data', // toScan page, transport order print detail for new design
    transportOrderLabel: 'print', // toScan page, transport order label
    completeTransportOrder: 'packed', // toScan page, transport order complete
    reOpenTransportOrder: 'reopen', // toScan page, transport order reopen
  },
};

I remove the inline comment and these code will autofix.

@hawtim
Copy link

hawtim commented Aug 12, 2021

I update the eslint-playground

https://github.com/hawtim/eslint-playground

run npm run sort-keys

@namnm
Copy link
Owner Author

namnm commented Aug 12, 2021

@hawtim I published version 2.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants