Package Exports
- eslint-config-eye
- eslint-config-eye/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-eye) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Let's respect our eyes -- eslint code style config
This package provides configured eslint rules mostly for my -- Evolveye. If you are interested in this code style, or if you want to propose changes -- just start new discussion.
export type Type = {
propA: string
propB: number
func: (arg:string) => number
}
class ClassA {}
class ClassB<T=number > {
a: T
b: string = ``
constructor( a:T ) {
this.a = a
}
method1( a, { c } ) {}
method2({ c }) {}
method3 = a => {}
}
const something = []
const obj = {
fnExp1() {},
fnExp2<T>( a:T ) {},
fnExp3: a => obj,
}
const arrow_params = ({ abc }, a) => true
const arrow_obj = ([ abc ]) => true
const arrow_empty = () => true
const arrow_var = a => true
const arrow = (a, b) =>
obj.fnExp3( 123 ) ?? true
function * fnGen( a, b, { c } ) {}
function fnObj({ c }) {}
function fnArr([ a ]) {}
function fn( a, b, { c } ) {}
function fnNothing() {}
fnObj({ c:3 })
fnArr([ 3 ])
fn( 1, 2, { c:3 } )
fnNothing()
fn( 1, 2, something[ 2 ] )
obj.fnExp2( 123 )
obj.fnExp3( 1 ).fnExp2({ a:1 })
switch (true) {
case true: 1
default: 2
}
if (something[ 0 ]) { /* */ }
if (!arrow( 1, 2 )) { /* */ }
for (const value of [ 1, 2, 3 ]);
for (const prop in {});
for (let i = 0; i < 1; ++i);
for (let i; (i = /reg/.exec( `` )););
while (false);
const jsx = (
<article>
<span about="" accessKey="" aria-activedescendant="" />
123
<span
about=""
accessKey=""
aria-activedescendant=""
children="abc"
/>
<span>abc {123} def</span>
</article>
)
function Component() {
return (
<p>text</p>
)
}
const instanceA = new ClassA()
const instanceB = new ClassB<number>( 1 )
const instanceC = new obj.fnExp2( 1 )Preconfigured babel and react
I wanted to create one module that could set all dependencies by itself. And this is it! This config is seting up the Babel parser for JavaScript classes (private fields, static fields, arrow methods), and React for JSX (but JSX is not part of the React, IK).
Eslint rules
I configured it only for me (because nobody other wanted to use it ), so code style can be a little... It can be not for everybody, I know it.
Also, I made some custom rules. You can find them here