Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions app/javascript/packages/eslint-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
## Unreleased

### Backwards-compatible changes

- Disabled many stylistic rules which would be redundant with Prettier formatting. For stylistic enforcement, it's recommended to opt-in to the optional Prettier rule extension.
- `array-bracket-spacing`
- `arrow-parens`
- `arrow-spacing`
- `block-spacing`
- `brace-style`
- `comma-spacing`
- `comma-style`
- `computed-property-spacing`
- `dot-location`
- `func-call-spacing`
- `function-call-argument-newline`
- `generator-star-spacing`
- `jsx-quotes`
- `key-spacing`
- `keyword-spacing`
- `no-extra-semi`
- `no-tabs`
- `no-trailing-spaces`
- `object-curly-spacing`
- `padded-blocks`
- `quote-props`
- `rest-spread-spacing`
- `semi`
- `semi-spacing`
- `semi-style`
- `space-in-parens`
- `switch-colon-spacing`
- `template-curly-spacing`
- `template-tag-spacing`
- `yield-star-spacing`
- TypeScript: More default ESLint rules have been substituted with TypeScript-enhanced versions:
- `default-param-last`
- `lines-between-class-members`
- `no-array-constructor`
- `no-dupe-class-members`
- `no-empty-function`
- `no-loop-func`
- `no-loss-of-precision`
- `no-redeclare`
- `no-useless-constructor`

## v2.0.0 (2022-03-14)

### Breaking changes
Expand Down
59 changes: 59 additions & 0 deletions app/javascript/packages/eslint-plugin/configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,32 @@ const config = {
es6: true,
},
rules: {
'array-bracket-spacing': 'off',
'arrow-parens': 'off',
'arrow-spacing': 'off',
'block-spacing': 'off',
'brace-style': 'off',
'class-methods-use-this': 'off',
'comma-dangle': 'off',
'comma-spacing': 'off',
'comma-style': 'off',
'computed-property-spacing': 'off',
'consistent-return': 'off',
curly: ['error', 'all'],
'dot-location': 'off',
'func-call-spacing': 'off',
'func-names': 'off',
'function-call-argument-newline': 'off',
'function-paren-newline': 'off',
'generator-star-spacing': 'off',
'prefer-arrow-callback': 'off',
'import/prefer-default-export': 'off',
'import/extensions': ['off', 'never'],
'import/no-extraneous-dependencies': 'error',
indent: 'off',
'jsx-quotes': 'off',
'key-spacing': 'off',
'keyword-spacing': 'off',
'max-len': 'off',
'max-classes-per-file': 'off',
'newline-per-chained-call': 'off',
Expand All @@ -27,15 +42,30 @@ const config = {
'no-param-reassign': ['off', 'never'],
'no-promise-executor-return': 'off',
'no-confusing-arrow': 'off',
'no-extra-semi': 'off',
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'no-tabs': 'off',
'no-trailing-spaces': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
quotes: 'off',
'implicit-arrow-linebreak': 'off',
'object-curly-newline': 'off',
'object-curly-spacing': 'off',
'operator-linebreak': 'off',
'padded-blocks': 'off',
'quote-props': 'off',
'require-await': 'error',
'rest-spread-spacing': 'off',
semi: 'off',
'semi-spacing': 'off',
'semi-style': 'off',
'space-in-parens': 'off',
'switch-colon-spacing': 'off',
'template-curly-spacing': 'off',
'template-tag-spacing': 'off',
'yield-star-spacing': 'off',
},
overrides: /** @type {Array<import('eslint').Linter.ConfigOverride>} */ ([]),
};
Expand Down Expand Up @@ -83,12 +113,41 @@ if (isInstalled('@typescript-eslint/parser') && isInstalled('@typescript-eslint/
config.plugins.push('@typescript-eslint');
config.extends.push('plugin:import/typescript');
Object.assign(config.rules, {
'@typescript-eslint/default-param-last': ['error'],
'@typescript-eslint/lines-between-class-members': [
'error',
'always',
{
exceptAfterSingleLine: false,
},
],
'@typescript-eslint/no-array-constructor': ['error'],
'@typescript-eslint/no-dupe-class-members': ['error'],
'@typescript-eslint/no-empty-function': [
'error',
{
allow: ['arrowFunctions', 'functions', 'methods'],
},
],
'@typescript-eslint/no-loop-func': ['error'],
'@typescript-eslint/no-loss-of-precision': ['error'],
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-useless-constructor': ['error'],
'default-param-last': 'off',
'lines-between-class-members': 'off',
'no-array-constructor': 'off',
'no-dupe-class-members': 'off',
'no-empty-function': 'off',
'no-loop-func': 'off',
'no-loss-of-precision': 'off',
'no-redeclare': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'no-useless-constructor': 'off',
});
config.overrides.push({
files: '*.{ts,tsx}',
Expand Down