blond / eslint-config-pedant Goto Github PK
View Code? Open in Web Editor NEW:bowtie: Pedant preset for eslint
License: MIT License
:bowtie: Pedant preset for eslint
License: MIT License
https://eslint.org/blog/2018/11/jsdoc-end-of-life
It is suggested to be replaced by https://github.com/gajus/eslint-plugin-jsdoc
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
package.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
This rule is important only for ES3
:
This can cause problems with
IE6/7
andIE9
if it's in quirksmode. Also, in some implementations of ES3 would add length to an array if it had an additional trailing comma. This was clarified inES5
(source):
This was clarified in ES5
(source):
Edition 5 clarifies the fact that a trailing comma at the end of an ArrayInitialiser does not add to the length of the array. This is not a semantic change from Edition 3 but some implementations may have previously misinterpreted this.
For ES5
and ES2015
this rule is more stylistic. For, example, you may want to use trailing commas to cleaner git diffs:
// bad - git diff without trailing comma
const hero = {
firstName: 'Florence',
- lastName: 'Nightingale'
+ lastName: 'Nightingale',
+ inventorOf: ['coxcomb graph', 'modern nursing']
};
// good - git diff with trailing comma
const hero = {
firstName: 'Florence',
lastName: 'Nightingale',
+ inventorOf: ['coxcomb chart', 'modern nursing'],
};
I don't want to eslint-config-pedant
limit your choice of code style.
Please provide some info on how to lint *.deps.js
files with eslint-config-pedant
as a base.
Add sub configs for different ES versions:
es3
es5
es6
By default need provide es6
.
{
"extends": "pedant"
}
But user should be able choose es3
and es5
:
{
"extends": "pedant/es3"
}
yarn warns consumers with this warning, but it seems like it still works. perhaps we can loose the peerDeps range?
Need replaced deprecated rules:
no-native-reassign
-> no-global-assignno-negated-in-lhs
-> no-unsafe-negationAdd semantic versioning policy to README.md
.
Add preset for examples in JsDoc and .md
files.
This preset should consist of the same pedant
rules without:
no-new
no-unused-expressions
no-undef
For some cases need override Object
methods.
Example:
class A {
toString() {
return '[MySuperObject]'; // error Expected 'this' to be used by class method 'toString' class-methods-use-this
}
}
I think need ignore next methods:
what about allow to set trailing-comma in function calls/params and other places?
In es2015 trailing comma is ok in some places
see here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas
I suggest to apply this rule in the default pedant config (not for es3, es5)
The eslint-config-pedant
package does not provide knowledge about minimal required version of eslint
.
падает с такой ошибкой:
./app/scripts/app.js
Module build failed: Error: pedant:
Configuration for rule "no-dupe-args" is invalid:
Value "error" is the wrong type.
...Referenced from .eslintrc
запускаю линтер через вебпаковый лоадер eslint-loader
в конфиге вебпака это выглядит как добавление лоадера вот такой строкой:
{
test: /\.js$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
и добавлением в массив плагинов вот этого
eslint: {
configFile: path.join(__dirname, '.eslintrc'),
emitErrors: false,
emitWarning: true,
formatter: eslintFormatter({notify})
}
версии:
$ cat package.json | grep eslint
"lint:scripts": "eslint app gulp",
"babel-eslint": "^4.1.5",
"eslint": "^1.9.0",
"eslint-config-pedant": "^0.3.0",
"eslint-loader": "^1.1.1",
"eslint-config-pedant": "^0.3.0"
.eslintrc
env:
browser: true
es6: true
extends: pedant
parserOptions:
ecmaVersion: 7
sourceType: module
npm install --save-dev eslint-config-pedant
npm install --save-dev [email protected]
тоже не помогло.
Сразу прошу прошения за многобукв и кажущуюся лень -- но я хз как на сайте eslint искать в какой версии еслинта у нас настройка "no-dupe-args" депрекейтнулась :(
Еси впадлу отвечать - свистни я закрою этот ишьюс
Now pedant will complain if parameter has no description.
/**
* Evals file contents
* @param {Function} callback
* @param {Object} options
* @returns {Object}
*/
function fileEval(file, options, callback) {
/* ... */
}
For some parameters, such as callback
or options
the description is superfluous.
Need turn off requireParamDescription
option.
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.