Skip to content

Commit

Permalink
Use eslint for ts files and run on staged files
Browse files Browse the repository at this point in the history
fix lint-staged

update lint-staged

update lint-staged

Remove unused log file

Add a root tsconfig for eslint

wip

Prep for linting

clean up base config inheritance

Update lint config
  • Loading branch information
Steven Silvester committed Apr 11, 2020
1 parent a1c2b33 commit d951a53
Show file tree
Hide file tree
Showing 10 changed files with 334 additions and 205 deletions.
20 changes: 10 additions & 10 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
node_modules
**/build
**/lib
**/node_modules
**/mock_packages
**/static
**/typings
**/schemas
**/themes
tests/**/coverage
*.map.js
*.bundle.js

dev_mode/index.js
dev_mode/schemas
!dev_mode/static/index.out.js
dev_mode/static
dev_mode/themes
dev_mode/workspaces
docs/_build
docs/api
examples/app/build
examples/app/schemas
examples/app/themes
docs/build
examples/chrome-example-test.js
jupyterlab/chrome-test.js
jupyterlab/geckodriver
jupyterlab/schemas
packages/extensionmanager-extension/examples/listings
jupyterlab/staging/index.js
jupyterlab/staging/yarn.js
jupyterlab/themes
packages/ui-components/src/icon/iconimports.ts
jupyterlab/staging/yarn.js
jupyterlab/staging/index.js

# jetbrains IDE stuff
.idea/
Expand Down
23 changes: 0 additions & 23 deletions .eslintrc

This file was deleted.

249 changes: 249 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
module.exports = {
env: {
browser: true,
es6: true,
commonjs: true
},
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.eslint.json'
},
plugins: ['@typescript-eslint'],
rules: {
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
'no-console': [
'error',
{
allow: ['error', 'warn', 'debug']
}
],
'arrow-body-style': [0],
curly: 'error',
'lines-around-comment': [0],
'max-len': 'off',
'no-confusing-arrow': [0],
'no-mixed-operators': [0],
'no-tabs': [0],
'no-unexpected-multiline': [0],
'prefer-arrow-callback': [0],
quotes: [0],
'array-bracket-newline': ['off'],
'array-bracket-spacing': ['off'],
'array-element-newline': ['off'],
'arrow-parens': ['off'],
'arrow-spacing': ['off'],
'block-spacing': ['off'],
'brace-style': ['off'],
'comma-dangle': 'off',
'comma-spacing': ['off'],
'comma-style': ['off'],
'computed-property-spacing': ['off'],
'dot-location': ['off'],
'eol-last': 'error',
'func-call-spacing': ['off'],
'function-call-argument-newline': ['off'],
'function-paren-newline': ['off'],
'generator-star': ['off'],
'generator-star-spacing': ['off'],
'implicit-arrow-linebreak': ['off'],
'jsx-quotes': ['off'],
'key-spacing': ['off'],
'keyword-spacing': ['off'],
'multiline-ternary': ['off'],
'newline-per-chained-call': ['off'],
'new-parens': 'error',
'no-arrow-condition': ['off'],
'no-comma-dangle': ['off'],
'no-extra-parens': ['off'],
'no-extra-semi': ['off'],
'no-floating-decimal': ['off'],
'no-mixed-spaces-and-tabs': ['off'],
'no-multi-spaces': ['off'],
'no-multiple-empty-lines': 'off',
'no-reserved-keys': ['off'],
'no-space-before-semi': ['off'],
'no-trailing-spaces': 'error',
'no-whitespace-before-property': ['off'],
'no-wrap-func': ['off'],
'nonblock-statement-body-position': ['off'],
'object-curly-newline': ['off'],
'object-curly-spacing': ['off'],
'object-property-newline': ['off'],
'one-var-declaration-per-line': ['off'],
'operator-linebreak': ['off'],
'padded-blocks': ['off'],
'quote-props': ['off'],
'rest-spread-spacing': ['off'],
semi: ['off'],
'semi-spacing': ['off'],
'semi-style': ['off'],
'space-after-function-name': ['off'],
'space-after-keywords': ['off'],
'space-before-blocks': ['off'],
'space-before-function-paren': ['off'],
'space-before-function-parentheses': ['off'],
'space-before-keywords': ['off'],
'space-in-brackets': ['off'],
'space-in-parens': ['off'],
'space-infix-ops': ['off'],
'space-return-throw-case': ['off'],
'space-unary-ops': ['off'],
'space-unary-word-ops': ['off'],
'switch-colon-spacing': ['off'],
'template-curly-spacing': ['off'],
'template-tag-spacing': ['off'],
'unicode-bom': ['off'],
'wrap-iife': ['off'],
'wrap-regex': ['off'],
'yield-star-spacing': ['off'],
'indent-legacy': ['off'],
'no-spaced-func': ['off'],
'constructor-super': ['error'],
'for-direction': ['error'],
'getter-return': ['error'],
'no-async-promise-executor': ['error'],
'no-case-declarations': ['off'],
'no-class-assign': ['error'],
'no-compare-neg-zero': ['error'],
'no-cond-assign': 'error',
'no-const-assign': ['error'],
'no-constant-condition': ['error'],
'no-control-regex': ['off'],
'no-debugger': 'error',
'no-delete-var': ['error'],
'no-dupe-args': ['error'],
'no-dupe-class-members': ['error'],
'no-dupe-keys': ['error'],
'no-duplicate-case': ['error'],
'no-empty': 'error',
'no-empty-character-class': ['error'],
'no-empty-pattern': ['error'],
'no-ex-assign': ['error'],
'no-extra-boolean-cast': ['error'],
'no-fallthrough': 'error',
'no-func-assign': ['error'],
'no-global-assign': ['error'],
'no-inner-declarations': ['off'],
'no-invalid-regexp': ['error'],
'no-irregular-whitespace': ['error'],
'no-misleading-character-class': ['error'],
'no-new-symbol': ['error'],
'no-obj-calls': ['error'],
'no-octal': ['error'],
'no-prototype-builtins': ['off'],
'no-redeclare': 'warn',
'no-regex-spaces': ['error'],
'no-self-assign': ['error'],
'no-shadow-restricted-names': ['error'],
'no-sparse-arrays': ['error'],
'no-this-before-super': ['error'],
'no-unreachable': ['error'],
'no-unsafe-finally': ['error'],
'no-unsafe-negation': ['error'],
'no-unused-labels': 'error',
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-namespace': 'off',
'no-useless-catch': ['error'],
'no-useless-escape': ['off'],
'no-with': ['error'],
'require-yield': ['error'],
'use-isnan': 'error',
'valid-typeof': ['error'],
'@typescript-eslint/class-name-casing': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'off',
{
accessibility: 'explicit'
}
],
'@typescript-eslint/indent': [
'error',
2,
{
FunctionDeclaration: {
parameters: 'first'
},
FunctionExpression: {
parameters: 'first'
}
}
],
'@typescript-eslint/interface-name-prefix': [
'error',
{ prefixWithI: 'always' }
],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true
},
singleline: {
delimiter: 'semi',
requireLast: false
}
}
],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/quotes': [
'off',
'single',
{
avoidEscape: true
}
],
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/camelcase': 'off',
'default-case': 'error',
'dot-notation': 'off',
'no-undef': 'off',
'prefer-const': 'warn',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'off',
'id-blacklist': ['error', 'any', 'boolean', 'Undefined'],
'id-match': 'error',
'import/no-default-export': 'off',
'no-bitwise': 'off',
'no-caller': 'error',
'no-eval': 'error',
'no-invalid-this': 'off',
'no-new-wrappers': 'error',
'no-null/no-null': 'off',
'no-shadow': [
'off',
{
hoist: 'all'
}
],
'no-underscore-dangle': 'off',
'no-var': 'error',
'one-var': ['error', 'never'],
radix: 'error',
'spaced-comment': 'error',
'@typescript-eslint/no-non-null-assertion': 'off'
},
settings: {}
};
Loading

0 comments on commit d951a53

Please sign in to comment.