Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESlint github package #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
70 changes: 70 additions & 0 deletions dist/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
We use prettier for formatting code and eslint for linting and autofixing any
auto-fixable errors. This is all executed via the `prettier-eslint` package.
This packages uses `prettier` first and then pipes the formatted output into
`eslint --fix`.

The advantage of using this combiner package `prettier-eslint` is that first
both separate tools don't come into conflict with each other and second we are
able to define all rules we like in one place: here in the eslint config file.

If a prettier option is not defined here as an eslint rule, prettier's default
for that option will be used. The prettier defaults can be looked up here:
https://prettier.io/docs/en/options.html

We are using the recommended preset `eslint:recommended` and can extend it with
some additional presets as we see fit over time. Which rules are defined in
the `eslint:recommended` preset and which of those are auto-fixed can be
looked up here: https://eslint.org/docs/rules/

Our repository has a `./vscode/settings.json` that tells the prettier
plugin to delegate work to the `prettier-eslint` combiner package. It's up
to you if you like to have your code formatted on save with the vscode
'Format On Save' setting or only if you run the formatter yourself with
the 'Format Document' command from the command palettte.
Other editor users: Feel free to extend your editor settings here.
*/

module.exports = {
plugins: ['react', 'cypress', 'prettier'],
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:cypress/recommended', 'plugin:prettier/recommended'],
// use recommended rule set as a base for our configuration
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
env: {
browser: true,
node: true,
jest: true,
es6: true,
'cypress/globals': true
},
// These rules override any of the rules defined in the presets under the
// `extends` option and also any matching prettier options. If we want custom
// rules we can add them here later.
ignorePatterns: ['*.d.ts'],
rules: {
quotes: ['error', 'single', {
avoidEscape: true
}],
'react/no-unknown-property': ['error', {
ignore: ['css']
}],
'react/prop-types': 0
},
settings: {
react: {
version: '16.8.6'
}
},
globals: {
$: 'readonly',
Foundation: 'readonly',
Turbolinks: 'readonly'
}
};
1 change: 1 addition & 0 deletions node_modules/.bin/babel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/babel-external-helpers

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/browserslist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/jsesc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/parser

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/update-browserslist-db

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading