Skip to content

Commit

Permalink
Merge core rules into a object
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Aug 16, 2024
1 parent 318b783 commit 0404e23
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 195 deletions.
25 changes: 0 additions & 25 deletions core/deprecated.js

This file was deleted.

88 changes: 0 additions & 88 deletions core/layout.js

This file was deleted.

60 changes: 0 additions & 60 deletions core/problem.js

This file was deleted.

10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const rules = require('./plugins/core')

Check failure on line 1 in index.js

View workflow job for this annotation

GitHub Actions / eslint

Missing file extension for "./plugins/core"

Check failure on line 1 in index.js

View workflow job for this annotation

GitHub Actions / eslint

Unable to resolve path to module './plugins/core'
const getIgnorePatterns = require('./utils/getIgnorePatterns.js')

/**
Expand All @@ -20,7 +21,9 @@ module.exports = {
sourceType: 'module'
},
plugins: [],
rules: {},
rules: {
...rules
},
settings: {},
overrides: [
/**
Expand Down Expand Up @@ -139,11 +142,6 @@ module.exports = {
]
}

for (const name of ['deprecated', 'layout', 'problem', 'suggestion']) {
const rules = require(`./core/${name}`)
Object.assign(module.exports.rules, rules)
}

for (const name of [
'eslint-comments',
'import',
Expand Down
164 changes: 163 additions & 1 deletion core/suggestion.js → plugins/core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const confusingBrowserGlobals = require('confusing-browser-globals')

const allowedProperties = require('../utils/allowedProperties.js')
const prettier = require('../utils/prettier.js')

module.exports = {
'accessor-pairs': 'error',
Expand Down Expand Up @@ -198,5 +199,166 @@ module.exports = {
strict: 'error',
'symbol-description': 'error',
'vars-on-top': 'off',
yoda: 'error'
yoda: 'error',
'array-callback-return': ['error', { allowImplicit: true }],
'constructor-super': 'error',
'for-direction': 'error',
'getter-return': 'error',
'no-async-promise-executor': 'error',
'no-await-in-loop': 'off',
'no-class-assign': 'error',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-constant-binary-expression': 'error',
'no-constant-condition': 'error',
'no-constructor-return': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': ['error', { includeExports: true }],
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-fallthrough': 'error',
'no-func-assign': 'error',
'no-import-assign': 'error',
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': ['error', { skipStrings: false }],
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'error',
'no-new-native-nonconstructor': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-promise-executor-return': 'error',
'no-prototype-builtins': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-setter-return': 'error',
'no-sparse-arrays': 'off',
'no-template-curly-in-string': 'off',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'off',
'no-unmodified-loop-condition': 'off',
'no-unreachable': 'error',
'no-unreachable-loop': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unused-private-class-members': 'error',
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-use-before-define': 'error',
'no-useless-backreference': 'error',
'require-atomic-updates': 'off',
'use-isnan': ['error', { enforceForIndexOf: true }],
'valid-typeof': 'error',
'callback-return': 'off',
'global-require': 'off',
'handle-callback-err': 'off',
'id-blacklist': 'off',
'indent-legacy': 'off',
'lines-around-directive': 'off',
'newline-after-var': 'off',
'newline-before-return': 'off',
'no-buffer-constructor': 'off',
'no-catch-shadow': 'off',
'no-mixed-requires': 'off',
'no-native-reassign': 'off',
'no-negated-in-lhs': 'off',
'no-new-require': 'off',
'no-path-concat': 'off',
'no-process-env': 'off',
'no-process-exit': 'off',
'no-restricted-modules': 'off',
'no-spaced-func': 'off',
'no-sync': 'off',
'prefer-reflect': 'off',
'require-jsdoc': 'off',
'valid-jsdoc': 'off',
'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': 'off',
'func-call-spacing': 'off',
'function-call-argument-newline': 'off',
'function-paren-newline': 'off',
'generator-star-spacing': 'off',
'implicit-arrow-linebreak': 'off',
indent: 'off',
'jsx-quotes': 'off',
'key-spacing': 'off',
'keyword-spacing': 'off',
'line-comment-position': 'error',
'linebreak-style': 'off',
'lines-around-comment': [
'error',
{
allowBlockStart: true,
allowObjectStart: true,
allowArrayStart: true,
allowClassStart: true
}
],
'lines-between-class-members': 'error',
'max-len': [
'error',
{
code: prettier.js.printWidth,
ignorePattern: /^(?!\s+(\/\/|\*))|eslint-disable/.source,
ignoreUrls: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true
}
],
'max-statements-per-line': 'off',
'multiline-ternary': 'off',
'new-parens': 'off',
'newline-per-chained-call': 'off',
'no-extra-parens': 'off',
'no-mixed-spaces-and-tabs': 'off',
'no-multi-spaces': 'off',
'no-multiple-empty-lines': 'off',
'no-tabs': ['error', { allowIndentationTabs: true }],
'no-trailing-spaces': 'off',
'no-whitespace-before-property': 'off',
'nonblock-statement-body-position': 'off',
'object-curly-newline': 'off',
'object-curly-spacing': 'off',
'object-property-newline': 'off',
'operator-linebreak': 'off',
'padded-blocks': 'off',
'padding-line-between-statements': 'off',
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
'rest-spread-spacing': 'off',
semi: 'off',
'semi-spacing': 'off',
'semi-style': 'off',
'space-before-blocks': 'off',
'space-before-function-paren': 'off',
'space-in-parens': 'off',
'space-infix-ops': 'off',
'space-unary-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'
}
Loading

0 comments on commit 0404e23

Please sign in to comment.