Code Monkey home page Code Monkey logo

jscs-config-seegno's People

Contributors

fixe avatar madeiras avatar nunofgs avatar ruimarinho avatar ruipenso avatar ruiquelhas avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jscs-config-seegno's Issues

Remove validateOrderInObjectKeys rule

We should remove "validateOrderInObjectKeys": "asc-natural" as we are relying on eslint's sorting/sort-object-props.

This also prevents the following error when using babel:

Error running rule validateOrderInObjectKeys: This is an issue with JSCS and not your codebase.

Support ES5 and ES6/ES2015 projects

This repository is only useful for ES6 projects since there are multiple rules that enforce ES6-only features.

I'd like to start a discussion regarding solving this issue for users who are still maintaining ES5 projects.

The way I see it, we have a few options:

  1. We can keep it as is and update the README.md to make it clear we do not support ES5 projects.
  2. We can split this repository into two:
    • jscs-config-seegno-es5 would contain the base rules.
    • jscs-config-seegno-es2015 would contain the ES2015-specific rules and would extend the es5 repo.
  3. We can update the README.md to instruct users on how to disable all ES6 rules if needed.

WDYT?

Normalize YAML sequence format

Use space after opening square brackets and before closing square brackets and avoid single (') or double (") quotes for Strings when they are not needed.

Fix issue in padding newlines before keywords rule

When using ES6 syntax, the "requirePaddingNewlinesBeforeKeywords" rule fails when exporting a function. For example:

export function create() {
   
}

Will return the error:

Keyword `function` should have an empty line above it:
    89 | */
    90 |
    91 |export function create() {
--------------^

However, if the export keyword is removed, the rule works.

Required new line before `typeof`

Currently, when the module tries to lint itself, we get the following error:

Keyword `typeof` should have an empty line above it at ./src/rules/require-should-assertion-execution.js :
    14 |const Assertion = should.Assertion.prototype;
    15 |const assertions = Object.keys(Assertion);
    16 |const chains = Object.keys(Assertion).filter(key => typeof Assertion[key] !== 'function');
-----------------------------------------------------------^
    17 |
    18 |/**

As far as I am aware, there is no good reason for this requirement, so we should just remove it.

Remove `jscs` dependency

jscs is currently required as a dependency because it's being used for testing the custom rules and validating the additional code written for that matter, and also to allow the rules to be declared in yaml.

To shave some bytes from production installs, it can be moved to devDependencies, which still allows to test the custom rules but prevents the other use-cases.

False positives for requireSqlTemplateInQueryFunction

This rule seems to suggest that for raw SQL queries, we should use the SQL template, like:

sequelize.query(sql`SELECT * FROM users`)

However, when we run jscs with preset: seegno without disabling this rule, we get errors like:

Use the `sql` tagged template literal for raw queries at X :
    32 |    let query = sql`UPDATE "Users" SET X`;
    33 |
    34 |    return sequelize.query(query)
-----------------------------------^
    35 |      .then(function(result) {
    36 |        done(null, result);

Based on my understanding of the rule, this looks like a false positive. Is my assumption correct, or am I misunderstanding something?

Installing should package

Since should package is registered as a devDependency and peerDependency, anyone that follows the instructions and isn't using should runs into an UNMET PEER DEPENDENCY warning followed by a Cannot find module 'should' error when running jscs.

The package is used in the requireShouldAssertionExecution rule, so I think we have two options:

  1. Move should from devDependencies to dependencies.
  2. Add should to the installation instructions on README.md.

Add `should.js` as a peer dependency

The require-should-assertion-execution rule requires [email protected] due to the assumptions it makes on the Assertion prototype object.

Please consider adding should.js as a peer dependency for other dependees.

Note, here is the cryptic error you'll receive if you have should.js < 8.x:

$ jscs src/
expected undefined to be true

See ruimarinho/sql-tag#2 for more information.

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.