Is prettier redundant when using eslint + airbnb - eslint

This is a continuation of Is Prettier really needed when using Eslint?
My understanding is that historically eslint was primarily used for code quality issues and design patterns, things that impact how the code is consumed by the Javascript engine. In contrast, Prettier was used for things that are purely stylistic. However looking at the capabilities of eslint, especially when using the Airbnb style guide, it appears as though all stylistic issues are covered.
What, if any, rules might Prettier cover that are not covered by eslint (+Airbnb)?

Related

How do indicate that a Haskell package is in either an alpha/beta/release candidate stage?

Let us say that I have worked on a haskell library and am now ready to release a beta version of the software to hackage/make repo public on github etc.
Possible Solutions and why they do not work for me
Use packagename-0.0.0.1-alpha or similar.
The problem here is quite simple: The Haskell PVP Specification does not allow it: (bold is me)
The components of the version number MUST be numbers! Historically Cabal supported version numbers with string tags at the end, e.g. 1.0-beta This proved not to work well because the ordering for tags was not well defined. Version tags are no longer supported and mostly ignored, however some tools will fail in some circumstances if they encounter them.
Just use packagename-0.* until it is out of alpha/beta (and then use packagename-1.*).
The problem here is twofold:
This method would not work for describing relase candidates which are post version 1.
Programmers from other ecosystems, such as that of rust, where it is quite common to have a stable library in 0.*, might wrongly assume that this library is stable. (Of course, it could be mitigated somewhat with a warning in the README, but I would prefer a better solution still.)
So, what is the best (and most conventional in haskell) way to indicate that the library version is in alpha/beta stage of development or is a release candidate?
As far as I know, there is not a package-wide way to say this. However, you can add a module description that describes the stability of the module to each of your modules' documentation.
{-|
Stability: experimental
-}
module PackageName.ModuleName where

Is it a good idea to use ESLint and stylelint together in the same project

Does ESLint and Stylelint do the same thing (linting) the project or is one used specifically for certain files? Can I use them both in the same project? Is it a good idea to use more than one linter in general in the same project?
It would be totally appropriate to pair ESLint and Stylelint together. ESLint is for JavaScript, and Stylelint is for CSS.
Generally, I would make sure you're only using one linter per language, since you don't want them fighting with each other; however, as you can see above, it's quite common to use multiple linters for projects that use multiple languages.
Let me know if you have any more questions!

Instead of all file I use "use strict" in node project. Can I use "use strict" at one place and that will apply in all files [duplicate]

Could not find this answer anywhere, but I did find several mailing lists where this was discussed, these are rather old however and I have no idea if this is implemented or not.
Is there anyway to force using strict mode in node.js?
Writing "use strict"; in all my .js files... well, i prefer it being forced to using strict mode, rather than adding extra boilerplate.
According to Lloyd you can now place
"use strict";
at the top of your file in node >= 0.10.7, but if you want your whole app to run in strict (including external modules) you can do this
node --use_strict
In node 0.10.7 you can enforce strict mode at file level by placing "use strict"; at the top of your file. Finally!
Just use "use strict"; at the top of applicable files. I know it's tempting to try to cut out boilerplate, but it simply can not be done in Javascript. The node flag which shall not be named[1]
is undocumented, and unsupported by Node itself.
has faced proposals to remove it.
is node-specific and is not supported in any other JavaScript engine.
is unstandardized.
it is not the same as "use strict"; because it is a compiler global, and like all globals you're potentially adversely impacting someone else's code.
everything is subject to bugs. strict mode and sloppy-mode may be subject to different bugs. that is to say, some strict mode bugs are unique to strict mode
Some other programmers may think this is similar to -wALL or the like, it's not. This is standardized functionality that you're enabling in an ad-hoc fashion (breaking the standard) and changing everyone's compiler semantics.
Footnotes
The node flag is --use_strict. Don't use it.
You can also use
https://npmjs.org/package/use-strict
that is, write once
require('use-strict')
or even take a step forward and use
https://npmjs.org/package/node-strict
Please note that use-strict will turn on strict more on every module required after invocation.
If you prefer a not invasive approach, I wrote another module
https://www.npmjs.org/package/strict-mode
which enables strict mode only in your package. I think that is more a "Do What I Mean" solution.
You can also provide the strict flag on the shebang interpreter directive.
#!/usr/bin/env node --use_strict
But currently (at least pre v0.9.x) it suffers the same problems described by the comments in #chad-scira's answer discuss.
It's worth noting that ESLint enforces strict mode by default. It won't stop you from running node on a file that doesn't adhere to strict mode of course, but if you have ESLint as a required part of your build and CI process, then developers will only be able to commit strict-mode code.

Options for adding a minor feature to a crate that necessitates a new dependency

I want to add a relatively small feature to crate A which necessitates depending on a second crate B. A's maintainer reasonably objects about introducing a whole new dependency for a small, although potentially useful, feature.
What are the best ways of handling this? The options I can think of are:
make a new crate with the new feature (with dependencies on both A and B)
use Cargo "features" somehow so users have to opt in to the extra dependency.
1 seems suboptimal since it's a small feature that's pretty tied in to A, and it seems annoying to have to specially depend on a third crate, but 2 seems almost as bad...
Is there some way to compile my minor feature if and only if a crate explicitly depends on both A and B?
This is exactly the case optional features solve:
Cargo supports features to allow expression of:
conditional compilation options (usable through cfg attributes);
optional dependencies, which enhance a package, but are not required; and
clusters of optional dependencies, such as postgres, that would include the postgres package, the postgres-macros package, and
possibly other packages (such as development-time mocking libraries,
debugging tools, etc.).
Unfortunately, you seem to have already dismissed this option without any explanation as to why it's "almost bad", so... I guess the only option you have left is to fork the crate and apply your changes.

Does Babel work with haskell and how do I do it?

I want to know if anyone has manage to integrate Haskell with other languages by using Babel.
Note: I'm putting three different question similar to these about other languages that I care about.
Note2: I did search before putting this question here. The problem is, Babel is used by to many projects and pages.
The Haskell guys at LANL might have something working, but other than that, I see no evidence of integration.

Resources