eslint-plugin-codebox icon indicating copy to clipboard operation
eslint-plugin-codebox copied to clipboard

ES5 Support

Open hieuvp opened this issue 6 years ago • 2 comments

Do you have any plan in your roadmap to support ES5 using require?

Thank you and look forward to checking your response ❤️

hieuvp avatar Mar 23 '18 12:03 hieuvp

Well, actually I haven't (and tbbh the current architecture relies on assumption that imports are structured at the top), but if more people want this - I may add it Also, PRs are welcome for this one :)

asn007 avatar Mar 23 '18 12:03 asn007

Hi @asn007,

There are just a few cases using require:

  1. const api = require('module');

  2. const { get, post, patch } = require('module');

const {
  BadUserInputError, schemas: {
    unauthorizedError,
    badRequestError,
    internalError
  }
} = require('errors');
const {
  user: {
    email: emailSchema
  },
  headers: {
    authorizationHeaders: authHeadersSchema
  }
} = require('schemas');

exports in ES5 is even easier 1.

module.exports = {
  authId,
  tokenId
};
module.exports = createServer;

hieuvp avatar Mar 24 '18 04:03 hieuvp