Skip to content

Commit

Permalink
[add] add disable-styles for prettier support
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Mollweide committed Jul 17, 2017
1 parent df400a7 commit 97e2c8a
Show file tree
Hide file tree
Showing 25 changed files with 435 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {

####
- [configuration with flowtype](./documentation/with-flow.md)
- [configuration with prettier](./documentation/with-prettier.md)

### .eslintignore
```
Expand Down
7 changes: 7 additions & 0 deletions configurations/es5-browser-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {

extends: [
'./es5-disable-styles.js',
].map(require.resolve),

};
10 changes: 10 additions & 0 deletions configurations/es5-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {

extends: [
'../rules/best-practices-disable-styles.js',
'../rules/errors-disable-styles.js',
'../rules/style-disable-styles.js',
'../rules/variables-disable-styles.js',
].map(require.resolve),

};
8 changes: 8 additions & 0 deletions configurations/es5-node-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {

extends: [
'./es5-disable-styles.js',
'../rules/node-disable-styles.js',
].map(require.resolve),

};
7 changes: 7 additions & 0 deletions configurations/es6-browser-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {

extends: [
'./es6-disable-styles.js',
].map(require.resolve),

};
12 changes: 12 additions & 0 deletions configurations/es6-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {

extends: [
'../rules/best-practices-disable-styles.js',
'../rules/errors-disable-styles.js',
'../rules/style-disable-styles.js',
'../rules/variables-disable-styles.js',
'../rules/imports-disable-styles.js',
'../rules/es6-disable-styles.js',
].map(require.resolve),

};
8 changes: 8 additions & 0 deletions configurations/es6-node-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {

extends: [
'./es6-disable-styles.js',
'../rules/node-disable-styles.js',
].map(require.resolve),

};
8 changes: 8 additions & 0 deletions configurations/es6-react-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
'extends': [
'./es6-disable-styles.js',
'../rules/react-disable-styles.js',
'../rules/react-a11y-disable-styles.js',
].map(require.resolve),

};
8 changes: 8 additions & 0 deletions configurations/flow-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

module.exports = {

'extends': [
'../rules/flow-disable-styles.js',
].map(require.resolve),

};
2 changes: 1 addition & 1 deletion configurations/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
],
'extends': [
'../rules/flow.js',
],
].map(require.resolve),
'settings': {
'flowtype': {
'onlyFilesWithFlowAnnotation': true,
Expand Down
23 changes: 23 additions & 0 deletions documentation/with-prettier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### with prettier

If you using prettier you should disable all eslint styling rules

```
module.exports = {
"extends": [
"@namics/eslint-config/configurations/es6-browser.js",
"@namics/eslint-config/configurations/es6-browser-disable-styles.js"
]
};
```

```
module.exports = {
"extends": [
"@namics/eslint-config/configurations/es6-react.js",
"@namics/eslint-config/configurations/es6-react-disable-styles.js",
"@namics/eslint-config/configurations/flow.js",
"@namics/eslint-config/configurations/flow.js-disable-styles"
]
};
```
24 changes: 24 additions & 0 deletions rules/best-practices-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* global module */
/* not yet approved by skill group core team */
module.exports = {
rules: {
// specify curly brace conventions for all control statements
'curly': 0,

// enforces consistent newlines before or after dots
'dot-location': 0,

// disallow lexical declarations in case/default clauses
// http://eslint.org/docs/rules/no-case-declarations.html
'no-case-declarations': 0,

// disallow the use of leading or trailing decimal points in numeric literals
'no-floating-decimal': 0,

// disallow use of multiple spaces
'no-multi-spaces': 0,

// disallow use of multiline strings
'no-multi-str': 0,
},
};
17 changes: 17 additions & 0 deletions rules/errors-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global module */
/* not yet approved by skill group core team */
module.exports = {
rules: {
// require trailing commas in multiline object literals
'comma-dangle': 0,

// disallow unnecessary semicolons
'no-extra-semi': 0,

// disallow irregular whitespace outside of strings and comments
'no-irregular-whitespace': 0,

// Avoid code that looks like two expressions but is actually one
'no-unexpected-multiline': 0,
},
};
32 changes: 32 additions & 0 deletions rules/es6-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* global module */
/* not yet approved by skill group core team */
module.exports = {
rules: {
// enforces no braces where they can be omitted
// http://eslint.org/docs/rules/arrow-body-style
'arrow-body-style': 0,

// require parens in arrow function arguments
'arrow-parens': 0,

// require space before/after arrow function's arrow
// http://eslint.org/docs/rules/arrow-spacing
'arrow-spacing': 0,

// enforce the spacing around the * in generator functions
// http://eslint.org/docs/rules/generator-star-spacing
'generator-star-spacing': 0,

// disallow arrow functions where they could be confused with comparisons
// http://eslint.org/docs/rules/no-confusing-arrow
'no-confusing-arrow': 0,

// enforce usage of spacing in template strings
// http://eslint.org/docs/rules/template-curly-spacing
'template-curly-spacing': 0,

// enforce spacing around the * in yield* expressions
// http://eslint.org/docs/rules/yield-star-spacing
'yield-star-spacing': 0,
},
};
36 changes: 36 additions & 0 deletions rules/flow-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable */
/* global module */
/* not yet approved by skill group core team */
module.exports = {
rules: {


// enforces consistent use of trailing commas in Object and Tuple annotations.
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-delimiter-dangle
'flowtype/delimiter-dangle': 0,

// enforces consistent separators between properties in Flow object types.
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter
'flowtype/object-type-delimiter': 0,

// enforces consistent use of semicolons after type aliases.
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-semi
'flowtype/semi': 0,

// enforces consistent spacing after the type annotation colon.
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-space-after-type-colon
'flowtype/space-after-type-colon': 0,

// Enforces consistent spacing before the opening < of generic type annotation parameters.
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-space-before-generic-bracket
'flowtype/space-before-generic-bracket': 0,

// Enforces consistent spacing before the type annotation colon.
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-space-before-type-colon
'flowtype/space-before-type-colon': 0,

// Enforces consistent spacing around union and intersection type separators (| and &).
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-union-intersection-spacing
'flowtype/union-intersection-spacing': 0,
},
};
12 changes: 12 additions & 0 deletions rules/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ module.exports = {
// Overwrite require-jsdoc rule
'require-jsdoc': 0,

// disallow importing from the same path more than once
// http://eslint.org/docs/rules/no-duplicate-imports
'no-duplicate-imports': 0,

// disallow duplicate imports
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
'import/no-duplicates': 0,

// Prevent missing props validation in a React component definition
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
'react/prop-types': 0,

// enforces a particular style for boolean type annotations. This rule takes one argument.
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-boolean-style
'flowtype/boolean-style': [2, 'boolean'],
Expand Down
13 changes: 13 additions & 0 deletions rules/imports-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* global module */
/* not yet approved by skill group core team */
module.exports = {
rules: {

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/namespace.md
'import/namespace': 0,

// Require a newline after the last import/require in a group
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
'import/newline-after-import': 0,
},
};
2 changes: 1 addition & 1 deletion rules/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {

// warn on accessing default export property names that are also named exports
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
'import/no-named-as-default-member': 0,
'import/no-named-as-default-member': 2,

// disallow use of jsdoc-marked-deprecated imports
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
Expand Down
7 changes: 7 additions & 0 deletions rules/node-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* global module */
/* not yet approved by skill group core team */
module.exports = {
rules: {
// there aren't style rules for node
},
};
5 changes: 5 additions & 0 deletions rules/react-a11y-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
// there aren't style rules for node
},
};
2 changes: 1 addition & 1 deletion rules/react-a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
'jsx-a11y/href-no-hash': 0,

// Require <img> to have a non-empty `alt` prop, or role="presentation"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-has-alt.md
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
'jsx-a11y/alt-text': 2,

// Prevent img alt text from containing redundant words like "image", "picture", or "photo"
Expand Down
51 changes: 51 additions & 0 deletions rules/react-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* global module */
/* not yet approved by skill group core team */
module.exports = {
// View link below for react rules documentation
// https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules
rules: {
// specify whether double or single quotes should be used in JSX attributes
// http://eslint.org/docs/rules/jsx-quotes
'jsx-quotes': 0,

// Validate closing bracket location in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
'react/jsx-closing-bracket-location': 0,

// Enforce or disallow spaces inside of curly braces in JSX attributes
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
'react/jsx-curly-spacing': 0,

// Validate props indentation in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
'react/jsx-indent-props': 0,

// Limit maximum of props on a single line in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
'react/jsx-max-props-per-line': 0,

// Require render() methods to return something
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
'react/require-render-return': 0,

// Enforce spaces before the closing bracket of self-closing JSX elements
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
'react/jsx-tag-spacing': 0,

// Prevent missing parentheses around multilines JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
'react/jsx-wrap-multilines': 0,

// Require that the first prop in a JSX element be on a new line when the element is multiline
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
'react/jsx-first-prop-new-line': 0,

// enforce spacing around jsx equals signs
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
'react/jsx-equals-spacing': 0,

// enforce JSX indentation
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
'react/jsx-indent': 0,
},
};
5 changes: 5 additions & 0 deletions rules/strict-disable-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
// there aren't style rules for node
},
};
Loading

0 comments on commit 97e2c8a

Please sign in to comment.