Skip to content

Instantly share code, notes, and snippets.

@bradypp
Last active October 6, 2020 19:16
Show Gist options
  • Select an option

  • Save bradypp/4d4fb7bbf103cd7b9828cb98f2277b88 to your computer and use it in GitHub Desktop.

Select an option

Save bradypp/4d4fb7bbf103cd7b9828cb98f2277b88 to your computer and use it in GitHub Desktop.
config files
# http://EditorConfig.org
# Top-most EditorConfig file
root = true
# Global
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
module.exports = {
// Node
// npx install-peerdeps --dev eslint-config-airbnb-base
// yad prettier eslint eslint-config-prettier eslint-plugin-prettier eslint-config-node eslint-plugin-node eslint-config-airbnb eslint-config-airbnb-base eslint-plugin-import
// Add to package.json:
// "engines": {
// "node": ">=12.0.0"
// },
extends: ['airbnb', 'eslint:recommended', 'plugin:node/recommended', 'prettier'],
plugins: ['prettier'],
env: {
commonjs: true,
node: true,
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
},
// React
// npx install-peerdeps --dev eslint-config-airbnb
// yad prettier eslint eslint-config-prettier eslint-plugin-prettier eslint-config-node eslint-plugin-node eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-plugin-import eslint-config-airbnb
extends: ['airbnb', "airbnb/hooks", 'prettier/react', 'prettier'],
plugins: ['prettier'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
sourceType: 'module',
ecmaVersion: 2018,
},
env: {
browser: true,
es6: true,
node: true,
},
rules: {
// Common Rules
'prettier/prettier': 0,
'consistent-return': 0,
'func-names': 0,
'no-shadow': 0,
'import/no-unresolved': 0,
'no-nested-ternary': 0,
camelcase: 0,
'no-underscore-dangle': 0,
'no-console': [2, { allow: ['warn', 'error'] }],
'no-use-before-define': 0,
// React Rules
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx'] }],
'react/no-unescaped-entities': ['error', { forbid: ['>', '"', '}'] }],
'react/state-in-constructor': 0,
'react/prop-types': [2, { skipUndeclared: true }],
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/click-events-have-key-events': 0,
'import/prefer-default-export': 0,
'react/forbid-prop-types': 0,
'react/jsx-props-no-spreading': 0,
// Node Rules
'prefer-destructuring': [2, { object: true, array: false }],
'no-unused-vars': [2, { argsIgnorePattern: 'req|res|next|val' }],
},
}
# Normalize all files detected as text automatically
* text=auto
# The following overrides the above
# These files are text and should be normalized
*.php text
*.css text
*.cs text
*.js text
*.jsx text
*.ts text
*.tsx text
*.json text
*.htm text
*.html text
*.xml text
*.txt text
*.ini text
*.inc text
*.pl text
*.rb text
*.py text
*.scm text
*.sql text
*.htaccess text
*.sh text
# These files are binary and should be left untouched
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.pyc binary
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment