question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move some functions outside of the "create"?

See original GitHub issue

The version of ESLint you are using. Not related

The problem you want to solve. Since the linting in typescript is proposed to change to eslint now (https://eslint.org/blog/2019/01/future-typescript-eslint), it’s a hot demand for some popular eslint rules to recognize the typescript token as well. Apparently, those ts-specific, slightly extended rules shouldn’t be in eslint repo but in typescript-eslint. However, even tough only 10% of the change is necessary, it’s a hard work to extend these rules. That’s because the utility functions are defined inside the create function and hence not able to be exported (see https://github.com/eslint/eslint/pull/11965). That means, a new rule need to copy & paste these utility functions before that 10% change can be added.

Your take on the correct solution to problem. Are we able to refactor these rule to export those utility functions when necessary?

Are you willing to submit a pull request to implement this change? https://github.com/eslint/eslint/pull/11965

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Jul 9, 2019

Hi @fa93hws, thanks for the issue.

The biggest challenge to doing this is that in doing so, we have to make a tough decision: Do we consider this an expansion of the public API (in which case we are unable to refactor easily later on, and/or we would need to do semver-major releases more frequently)? Or do we not consider this an expansion of the public API (in which case, we would inadvertently break typescript-eslint and other consumers on semver-minor or semver-patch releases if we refactor some of the utility code).

Neither of these options sounds great to me. The fact is, at the moment, the ESLint core rules are not designed to be extensible. So if we’re going to make a change here, we need to do so thoughtfully.

0reactions
eslint-deprecated[bot]commented, Aug 10, 2019

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to move functions outside a loop - Stack Overflow
When I move it outside and assign it, the function breaks as 'self' becomes undefined. Any advice appreciated. javascript.
Read more >
Should you move functions outside of components : r/reactjs
Moving it outside a React component will not give you this benefit and, in the case of TypeScript, will require you to add...
Read more >
Move button functions outside main.py - Qt Forum
Hello, iam wondering if is possible to make in PyQt5 file for design of my app and file for functionality of my app....
Read more >
let - JavaScript - MDN Web Docs
let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used,...
Read more >
Is it best practice to define a member function directly in a class?
When a function is defined as part of the class definition, it is implicitly inline (regardless of whether you use that keyword).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found