hexojs / eslint-config-hexo Goto Github PK
View Code? Open in Web Editor NEWESLint config for Hexo projects
License: MIT License
ESLint config for Hexo projects
License: MIT License
(node:29131) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Can we update the module to replace "punycode"?
I mistakenly committed directly to the master branch.
After that I did a Revert and did a rewind but I think that I should avoid making such mistakes in the future.
Should I enable "Require confirmation of pull requests before merging" setting in the master branch?
I have faced the issue during reviewing the PR hexojs/hexo#3954
Currently we are using ['error', 'never']
:
Line 106 in ada1570
function foo() {
// ...
}
var bar = function() {
// ...
};
var bar = function foo() {
// ...
};
class Foo {
constructor() {
// ...
}
}
var foo = {
bar() {
// ...
}
};
var foo = async() => 1
IMHO we could add a space between async
& await
and function for better distinguishment (['error', {"anonymous": "never", "named": "never", "asyncArrow": "always"}]
), which will resulted in:
function foo() {
// ...
}
var bar = function() {
// ...
};
class Foo {
constructor() {
// ...
}
}
var foo = {
bar() {
// ...
}
};
var foo = async (a) => await a
"anonymous" and "named" retain
never
for consistency.
eslint
has nearly 90 rules even for category Stylistic Issues
alone.
It is very difficult to handle all these correctly.
Because eslint
understands that, if you activate only recommended settings, required items in most projects will be set. However, Stylistic Issues
often depends on individuality, the recommended config is no-mixed-spaces-and-tabs
only.
By using Prettier
it is certain that almost all of those settings will be unified.
However, that is a tradeoff with fewer things we can explicitly control.
In fact, the multi-line
option of the curly
rule will be disabled with Prettier
!
When i install config globally, plugin:node/recommended
will install into eslint-config-hexo
directory (under subdir). And plugin actually not work, because eslint
must see node
plugin in same level hierarchy. But then i install it locally, node
plugin will placed in same level as eslint
.
node -v && npm -v
v6.14.0
3.10.10
[root@localhost ivan-nginx]# npm i -g eslint-config-hexo
/usr/lib
├── UNMET PEER DEPENDENCY eslint@>= 3.1.0
└─┬ [email protected]
├── UNMET PEER DEPENDENCY eslint@>=3.1.0
└─┬ [email protected]
├── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected]
└── [email protected]
npm WARN [email protected] requires a peer of eslint@>= 3.1.0 but none was installed.
npm WARN [email protected] requires a peer of eslint@>=3.1.0 but none was installed.
Solution is — install eslint-plugin-node
separately:
npm i -g eslint-config-hexo eslint-plugin-node
There are duplicate parameters in Fixed in #6eslint.js
: dot-notation
and no-multi-str
. And i also see other parameters which already by default in eslint:recommended
settings.
All 'error'
strings can be sucessfully replaced by 2
: https://eslint.org/docs/user-guide/configuring#configuring-rules
No need to define parserOptions: { ecmaVersion: 6 }
parameter if env: { es6: true }
already defined: https://eslint.org/docs/user-guide/configuring#specifying-parser-options
Deprecated parameter 'eqeqeq': ['error', 'allow-null']
: https://eslint.org/docs/rules/eqeqeq#allow-null
strict
option not needed for ES6, because in ES6 this mode turned on by default.
About pull #6:
no-extra-label
now in Best Practices section.no-mixed-operators
now in Stylistic Issues section.comma-dangle
can be just error
, never
parameter is default for now.comma-spacing
can be just error
, before: false, after: true
is default for now.comma-style
can be just error
, last
is default for now.computed-property-spacing
can be just error
, never
is default for now.key-spacing
can be just error
, beforeColon: false, afterColon: true
is default for now.{"align": "colon"}
parameter.keyword-spacing
can be just error
, no needed to set empty ['error', {}]
parameters.linebreak-style
can be just error
, unix
is default for now.lines-around-comment
can be just error
, { beforeBlockComment: true }
is default for now.semi
can be just error
, always
is default for now.semi-spacing
can be just error
, before: false, after: true
is default for now.space-before-blocks
can be just error
, always
is default for now.space-before-function-paren
can be just error
, always
is default for now.space-in-parens
can be just error
, never
is default for now.spaced-comment
can be just error
, always
is default for now.template-tag-spacing
can be just error
, never
is default for now.unicode-bom
can be just error
, never
is default for now.rest-spread-spacing
can be just error
, never
is default for now.template-curly-spacing
can be just error
, never
is default for now.yield-star-spacing
can be just error
, after
is default for now.yoda
can be just error
, never
is default for now.Line 13 in a1cfa6c
env.mocha
shouldn't be added. cc @tomap @stevenjoezhang
@yoshinorin please consider mark 4.2.0 as deprecated, and we need a bugfix version 4.2.1 published.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.