Git Product home page Git Product logo

eslint-config-pedant's People

Contributors

blond avatar greenkeeper[bot] avatar greenkeeperio-bot avatar guria avatar jt3k avatar tadatuta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

guria birhoff jt3k

eslint-config-pedant's Issues

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If 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.

More information on this issue

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 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Remove comma-dangle rule for ES5

This rule is important only for ES3:

This can cause problems with IE6/7 and IE9 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 in ES5 (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.

Subconfigs

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"
}

it seems the pedant does not work from cli

I run the check with cli, and I see

error Parsing error: The keyword 'const' is reserved

by default the pedant must use the es2015 setting, but it gives an error on 'const'

why?

eslint and pedant installed globally
eslint v4.7.2
pedant v0.10.0

Examples preset

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
  • ???

no-dupe-args error in console

падает с такой ошибкой:

./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

  • я попробовал удалять глобальный eslint и устанавливать заново
    npm install --save-dev eslint-config-pedant
    (перед этим убрав его из package.json) но это не помогло.
    После этого возникает та же ошибка :(
  • также попробовал установить педант более старой версии:
    npm install --save-dev [email protected]

тоже не помогло.


Сразу прошу прошения за многобукв и кажущуюся лень -- но я хз как на сайте eslint искать в какой версии еслинта у нас настройка "no-dupe-args" депрекейтнулась :(


Еси впадлу отвечать - свистни я закрою этот ишьюс

Сalm valid-jsdoc

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.