seegno / jscs-config-seegno Goto Github PK
View Code? Open in Web Editor NEWSeegno-flavored JSCS config
Seegno-flavored JSCS config
When using [email protected]
.
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.
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:
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.WDYT?
Use space after opening square brackets and before closing square brackets and avoid single ('
) or double ("
) quotes for Strings
when they are not needed.
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.
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.
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.
It might make sense to have a rule that complains about:
let foo = {};
foo.bar = {
...
};
foo.baz = {
...
};
and suggests using:
let foo = {};
foo.bar = {
...
};
foo.baz = {
...
};
requirePaddingNewLinesAfterBlocks does not seem to do the trick.
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?
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:
should
from devDependencies
to dependencies
.should
to the installation instructions on README.md.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.
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.