Skip to content

Instantly share code, notes, and snippets.

@msalahz
Last active March 9, 2018 04:34
Show Gist options
  • Save msalahz/7bb384c8473445eb012874231f563832 to your computer and use it in GitHub Desktop.
Save msalahz/7bb384c8473445eb012874231f563832 to your computer and use it in GitHub Desktop.
eslint
module.exports = {
'extends': [
'airbnb',
'prettier',
'prettier/react'
],
"parser": "babel-eslint",
'parserOptions': {
'ecmaVersion': 8,
'ecmaFeatures': {
'experimentalObjectRestSpread': true,
'impliedStrict': true,
'classes': true
}
},
'env': {
'browser': true,
'node': true,
'jquery': true
},
'rules': {
'no-debugger': 0,
'no-unused-vars': [
1,
{
'argsIgnorePattern': 'res|next|^err'
}
],
'arrow-body-style': [
2,
'as-needed'
],
'no-param-reassign': [
2,
{
'props': false
}
],
'no-console': 0,
'import/prefer-default-export': 0,
'import': 0,
'func-names': 0,
'space-before-function-paren': 0,
'comma-dangle': 0,
'max-len': 0,
'import/extensions': 0,
'no-underscore-dangle': 0,
'consistent-return': 0,
'react/display-name': 1,
'react/react-in-jsx-scope': 0,
'react/forbid-prop-types': 0,
'react/no-unescaped-entities': 0,
'jsx-a11y/accessible-emoji': 0,
'react/jsx-filename-extension': [
1,
{
'extensions': [
'.js',
'.jsx'
]
}
],
'radix': 0,
'no-shadow': [
2,
{
'hoist': 'all',
'allow': [
'resolve',
'reject',
'done',
'next',
'err',
'error'
]
}
],
'quotes': [
2,
'single',
{
'avoidEscape': true,
'allowTemplateLiterals': true
}
],
'prettier/prettier': [
'error',
{
'trailingComma': 'es5',
'singleQuote': true,
'printWidth': 120
}
],
'jsx-a11y/href-no-hash': 'off',
'jsx-a11y/anchor-is-valid': [
'warn',
{
'aspects': [
'invalidHref'
]
}
]
},
'plugins': [
// "html",
'prettier'
]
};
yarn global add --dev eslint@^4.9.0 eslint-plugin-import@^2.7.0 eslint-plugin-jsx-a11y@^6.0.2 eslint-plugin-react@^7.4.0 eslint-config-airbnb@latest eslint-config-prettier prettier eslint-plugin-prettier react-app-rewired react-app-rewire-eslint
yarn add --dev eslint@^4.9.0 eslint-plugin-import@^2.7.0 eslint-plugin-jsx-a11y@^6.0.2 eslint-plugin-react@^7.4.0 eslint-config-airbnb@latest eslint-config-prettier prettier eslint-plugin-prettier react-app-rewired react-app-rewire-eslint
const rewireEslint = require('react-app-rewire-eslint');
module.exports = function override(config, env) {
config = rewireEslint(config, env);
return config;
};
{
"name": "react-fish-store",
"version": "0.0.3",
"private": true,
"devDependencies": {
"concurrently": "3.5.1",
"eslint": "^4.9.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.4.0",
"prettier": "^1.11.1",
"react-app-rewire-eslint": "^0.2.3",
"react-app-rewired": "^1.5.0",
"react-scripts": "1.1.1"
},
"dependencies": {
"autoprefixer-stylus": "0.14.0",
"firebase": "^4.10.0",
"prop-types": "^15.6.0",
"re-base": "3.2.2",
"react": "^16.3.0-alpha.1",
"react-dom": "^16.3.0-alpha.1",
"react-router-dom": "^4.2.2",
"react-transition-group": "^2.2.1",
"serve": "^6.5.0",
"stylus": "0.54.5"
},
"scripts": {
"start": "react-app-rewired start",
"watch": "concurrently --names \"webpack, stylus\" --prefix name \"npm run start\" \"npm run styles:watch\"",
"build": "react-app-rewired build",
"eject": "react-scripts eject",
"test": "react-app-rewired test — env=jsdom",
"styles": "stylus -u autoprefixer-stylus ./src/css/style.styl -o ./src/css/style.css",
"styles:watch": "stylus -u autoprefixer-stylus -w ./src/css/style.styl -o ./src/css/style.css",
"format": "prettier --trailing-comma es5 --single-quote --write 'src/*/*.js' 'src/*/!(node_modules)/**/*.js'",
"lint": "npm run format && eslint --fix --config .eslintrc.js src"
}
}
// Place your settings in this file to overwrite the default settings
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/tmp": true,
"**/dist": true,
".idea": true,
"jsconfig.json": true,
//"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/.next": true
},
"editor.formatOnType": true,
"workbench.iconTheme": "Monokai Pro Icons",
"typescript.referencesCodeLens.enabled": true,
"html.format.indentHandlebars": true,
"html.format.indentInnerHtml": true,
"window.zoomLevel": 0.5,
"terminal.integrated.fontSize": 14,
"files.autoSave": "off",
"editor.fontSize": 14,
"window.titleBarStyle": "custom",
"window.nativeTabs": false,
"emmet.triggerExpansionOnTab": true,
"files.exclude": {
"**/.DS_Store": true, // this is a default value
"**/node_modules": true, // this excludes all folders
// only from the root of
// your workspace
"dist": true,
"tmp": true,
".idea": true,
".vscode": true
// named "node_modules" from
// the explore tree
// alternative version
//"node_modules": true, // this excludes the folder
//"**/.git": true, // this is a default value
//"deploy": true,
//"tests": true,
//"jsconfig.json": true,
//".*": true,
},
"[plaintext]": {},
"liveServer.settings.donotShowInfoMsg": true,
"git.autofetch": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,
"typescript.format.insertSpaceBeforeFunctionParenthesis": false,
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"git.promptToSaveFilesBeforeCommit": true,
"cSpell.language": "en",
"cSpell.userWords": [
"endregion"
],
"workbench.colorTheme": "One Dark Pro Italic",
"workbench.editor.tabSizing": "fit",
"html.format.enable": true,
"html.format.preserveNewLines": true,
"files.trimTrailingWhitespace": true,
"editor.tabSize": 2,
// this isn't really underline but we hack it to be a thicker cursor
"editor.cursorStyle": "line",
"editor.wordWrap": "on",
"editor.multiCursorModifier": "ctrlCmd",
"editor.fontWeight": "400",
"editor.cursorBlinking": "solid",
"editor.colorDecorators": false,
"editor.minimap.enabled": false,
"workbench.activityBar.visible": true,
"workbench.sideBar.location": "left",
"editor.renderWhitespace": "none",
"editor.rulers": [
80,
100,
120
],
"editor.minimap.showSlider": "always",
"workbench.startupEditor": "newUntitledFile",
"extensions.ignoreRecommendations": false,
"workbench.editor.tabCloseButton": "off",
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
// show snippets before any other auto completion
"editor.snippetSuggestions": "top",
// this lets you quickly open multiple items in a row and not have the previous ones closed on you
"workbench.editor.enablePreviewFromQuickOpen": false,
"window.title": "${dirty} ${activeEditorMedium}${separator}${rootName}",
// These are all my auto-save configs
"editor.formatOnSave": true,
// turn it off for JS
"[javascript]": {
"editor.formatOnSave": false
},
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"fontshortcuts.defaultFontSize": 16,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment