Skip to content

Commit

Permalink
ADD linting on some rc files, CHANGe to js rc for remark
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jun 6, 2017
1 parent 0ecb1bf commit 7db3cc0
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 72 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ node_modules
**/example/**
**/demo/**
docs/public

!.remarkrc.js
!.eslintrc.js
!.eslintrc-markdown.js
!.jest.config.js
31 changes: 13 additions & 18 deletions .eslintrc-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ const ignore = 0;

module.exports = {
root: true,
extends: [
'eslint-config-airbnb',
'plugin:jest/recommended',
'prettier',
],
plugins: [
'prettier',
'jest',
'react',
],
extends: ['eslint-config-airbnb', 'plugin:jest/recommended', 'prettier'],
plugins: ['prettier', 'jest', 'react'],
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
Expand All @@ -29,13 +21,16 @@ module.exports = {
},
rules: {
strict: [error, 'never'],
'prettier/prettier': [warn, {
printWidth: 100,
tabWidth: 2,
bracketSpacing: true,
trailingComma: 'es5',
singleQuote: true,
}],
'prettier/prettier': [
warn,
{
printWidth: 100,
tabWidth: 2,
bracketSpacing: true,
trailingComma: 'es5',
singleQuote: true,
},
],
quotes: [warn, 'single'],
'no-unused-vars': ignore,
'class-methods-use-this': ignore,
Expand All @@ -54,4 +49,4 @@ module.exports = {
'jsx-a11y/accessible-emoji': ignore,
'react/no-unescaped-entities': ignore,
},
}
};
72 changes: 38 additions & 34 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ const ignore = 0;

module.exports = {
root: true,
extends: [
'eslint-config-airbnb',
'plugin:jest/recommended',
'prettier',
],
plugins: [
'prettier',
'jest',
'react',
],
extends: ['eslint-config-airbnb', 'plugin:jest/recommended', 'prettier'],
plugins: ['prettier', 'jest', 'react'],
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
Expand All @@ -25,40 +17,52 @@ module.exports = {
},
rules: {
strict: [error, 'never'],
'prettier/prettier': [warn, {
printWidth: 100,
tabWidth: 2,
bracketSpacing: true,
trailingComma: 'es5',
singleQuote: true,
}],
'prettier/prettier': [
warn,
{
printWidth: 100,
tabWidth: 2,
bracketSpacing: true,
trailingComma: 'es5',
singleQuote: true,
},
],
quotes: [warn, 'single'],
'class-methods-use-this': ignore,
'arrow-parens': [warn, 'as-needed'],
'space-before-function-paren': ignore,
'import/no-unresolved': warn,
'import/extensions': [warn, {
js: 'never',
json: 'always',
}],
'import/no-extraneous-dependencies': [warn, {
devDependencies: [
'**/*.test.js',
'**/scripts/*.js',
'**/stories/*.js',
'**/__tests__/*.js'
],
peerDependencies: true
}],
'import/extensions': [
warn,
{
js: 'never',
json: 'always',
},
],
'import/no-extraneous-dependencies': [
warn,
{
devDependencies: [
'**/*.test.js',
'**/scripts/*.js',
'**/stories/*.js',
'**/__tests__/*.js',
],
peerDependencies: true,
},
],
'import/prefer-default-export': ignore,
'react/jsx-wrap-multilines': ignore,
'react/jsx-uses-react': error,
'react/jsx-uses-vars': error,
'react/react-in-jsx-scope': error,
'react/jsx-filename-extension': [warn, {
extensions: ['.js', '.jsx']
}],
'react/jsx-filename-extension': [
warn,
{
extensions: ['.js', '.jsx'],
},
],
'jsx-a11y/accessible-emoji': ignore,
'react/no-unescaped-entities': ignore,
},
}
};
17 changes: 0 additions & 17 deletions .remarkrc

This file was deleted.

26 changes: 26 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
plugins: [
'remark-preset-lint-recommended',
['remark-lint-list-item-indent', false],
[
'remark-lint-code',
{
js: {
module: 'node_modules/remark-lint-code-eslint',
options: {
fix: true,
configFile:
'/Users/dev/Projects/GitHub/storybook/react-storybook/.eslintrc-markdown.js',
},
},
},
],
[
'remark-toc',
{
tight: true,
maxDepth: 3,
},
],
],
};
4 changes: 1 addition & 3 deletions lib/cli/generators/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const error = 2;
const warn = 1;
const ignore = 0;

module.exports = {
Expand All @@ -8,5 +6,5 @@ module.exports = {
'import/no-extraneous-dependencies': ignore,
'import/extensions': ignore,
'global-require': ignore,
}
},
};

0 comments on commit 7db3cc0

Please sign in to comment.