mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 13:54:25 +00:00
done
This commit is contained in:
@@ -1,75 +1,65 @@
|
||||
import stylisticTS from '@stylistic/eslint-plugin';
|
||||
// @ts-check
|
||||
|
||||
export default [
|
||||
{
|
||||
plugins: {
|
||||
'@stylistic/ts': stylisticTS,
|
||||
},
|
||||
languageOptions: {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {
|
||||
// Error prevention
|
||||
'prefer-const': 'error',
|
||||
'no-async-promise-executor': 'error',
|
||||
'no-cond-assign': 'error',
|
||||
'no-const-assign': 'error',
|
||||
'no-constant-condition': 'error',
|
||||
'no-debugger': 'error',
|
||||
'no-dupe-else-if': 'error',
|
||||
'no-dupe-keys': 'warn',
|
||||
'no-dupe-class-members': 'error',
|
||||
'no-dupe-args': 'error',
|
||||
'no-duplicate-case': 'error',
|
||||
'no-duplicate-imports': 'error',
|
||||
'no-empty-pattern': 'error',
|
||||
'no-fallthrough': 'error',
|
||||
'no-invalid-regexp': 'warn',
|
||||
'no-loss-of-precision': 'warn',
|
||||
'no-import-assign': 'error',
|
||||
'no-irregular-whitespace': 'error',
|
||||
'no-self-assign': 'error',
|
||||
'no-undef': 'warn',
|
||||
'no-unreachable': 'error',
|
||||
'no-unsafe-finally': 'error',
|
||||
'no-unsafe-negation': 'error',
|
||||
'no-unused-private-class-members': 'warn',
|
||||
'no-unused-vars': 'error',
|
||||
'no-use-before-define': 'error',
|
||||
|
||||
// Style
|
||||
'arrow-body-style': [ 'error', 'always' ],
|
||||
'camelcase': 'warn',
|
||||
'curly': [ 'error', 'all' ],
|
||||
'eqeqeq': [ 'error', 'always' ],
|
||||
'func-style': [ 'error', 'expression' ],
|
||||
'no-array-constructor': 'error',
|
||||
'no-else-return': 'error',
|
||||
'no-empty': 'warn',
|
||||
'no-empty-static-block': 'warn',
|
||||
'no-eval': 'error',
|
||||
'no-implicit-coercion': 'error',
|
||||
'no-invalid-this': 'warn',
|
||||
'no-multi-assign': 'warn',
|
||||
'no-new': 'error',
|
||||
'no-redeclare': 'error',
|
||||
'no-script-url': 'error',
|
||||
'no-shadow': 'error',
|
||||
'no-shadow-restricted-names': 'error',
|
||||
'no-underscore-dangle': 'warn',
|
||||
'no-unused-expressions': 'warn',
|
||||
'no-useless-constructor': 'warn',
|
||||
'no-var': 'warn',
|
||||
'prefer-arrow-callback': 'error',
|
||||
'prefer-exponentiation-operator': 'warn',
|
||||
'prefer-numeric-literals': 'error',
|
||||
'require-await': 'warn',
|
||||
import eslint from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import stylistic from '@stylistic/eslint-plugin';
|
||||
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
'plugins': {
|
||||
'@stylistic/js': stylistic,
|
||||
'@stylistic/ts': stylistic,
|
||||
},
|
||||
'rules': {
|
||||
// Formatting
|
||||
// https://eslint.style/rules/js/array-bracket-newline
|
||||
// TODO: Finish up
|
||||
'@stylistic/ts/indent': [ 'error', 4 ]
|
||||
'@stylistic/js/array-bracket-newline': [ 'error', { 'multiline': true, 'minItems': 4 } ],
|
||||
'@stylistic/js/array-bracket-spacing': [ 'error', 'always' ],
|
||||
'@stylistic/js/array-element-newline': [ 'error', { 'multiline': true, 'minItems': 4 } ],
|
||||
'@stylistic/js/arrow-parens': [ 'error', 'always' ],
|
||||
'@stylistic/js/arrow-spacing': [ 'error', { 'before': true, 'after': true } ],
|
||||
'@stylistic/js/block-spacing': [ 'error', 'always' ],
|
||||
'@stylistic/js/brace-style': [ 'error', '1tbs' ],
|
||||
'@stylistic/js/comma-spacing': [ 'error', { 'before': false, 'after': true } ],
|
||||
'@stylistic/js/comma-style': [ 'error', 'last' ],
|
||||
'@stylistic/js/dot-location': [ 'error', 'property' ],
|
||||
'@stylistic/js/eol-last': [ 'error', 'always' ],
|
||||
'@stylistic/js/function-call-spacing': [ 'error', 'never' ],
|
||||
'@stylistic/js/implicit-arrow-linebreak': [ 'error', 'beside' ],
|
||||
'@stylistic/js/indent': [ 'error', 4 ],
|
||||
'@stylistic/js/key-spacing': [ 'error', { 'beforeColon': false, 'afterColon': true } ],
|
||||
'@stylistic/js/keyword-spacing': [ 'error', { 'before': true, 'after': true } ],
|
||||
'@stylistic/js/lines-between-class-members': [ 'error', 'always' ],
|
||||
'@stylistic/js/new-parens': [ 'error', 'always' ],
|
||||
'@stylistic/js/no-extra-parens': [ 'error', 'all' ],
|
||||
'@stylistic/js/no-extra-semi': 'error',
|
||||
'@stylistic/js/no-floating-decimal': 'error',
|
||||
'@stylistic/js/no-mixed-operators': 'error',
|
||||
'@stylistic/js/no-mixed-spaces-and-tabs': 'error',
|
||||
'@stylistic/js/no-multi-spaces': 'error',
|
||||
'@stylistic/js/no-trailing-spaces': 'error',
|
||||
'@stylistic/js/no-whitespace-before-property': 'error',
|
||||
'@stylistic/js/object-curly-newline': [ 'error', { 'multiline': true, 'minProperties': 3 } ],
|
||||
'@stylistic/js/object-curly-spacing': [ 'error', 'always' ],
|
||||
'@stylistic/js/one-var-declaration-per-line': 'error',
|
||||
'@stylistic/js/quote-props': [ 'error', 'always' ],
|
||||
'@stylistic/js/quotes': [ 'error', 'single' ],
|
||||
'@stylistic/js/rest-spread-spacing': [ 'error', 'never' ],
|
||||
'@stylistic/js/semi': [ 'error', 'always' ],
|
||||
'@stylistic/js/semi-spacing': [ 'error', { 'before': false, 'after': true } ],
|
||||
'@stylistic/js/semi-style': [ 'error', 'last' ],
|
||||
'@stylistic/js/space-before-blocks': [ 'error', 'always' ],
|
||||
'@stylistic/js/space-before-function-paren': [ 'error', 'always' ],
|
||||
'@stylistic/js/space-in-parens': [ 'error', 'always' ],
|
||||
'@stylistic/js/space-infix-ops': [ 'error', { 'int32Hint': false } ],
|
||||
'@stylistic/js/space-unary-ops': 'error',
|
||||
'@stylistic/js/spaced-comment': [ 'error', 'always' ],
|
||||
'@stylistic/js/switch-colon-spacing': 'error',
|
||||
'@stylistic/js/template-curly-spacing': [ 'error', 'always' ],
|
||||
'@stylistic/js/wrap-iife': [ 'error', 'inside' ],
|
||||
'@stylistic/js/wrap-regex': 'error',
|
||||
'@stylistic/ts/type-annotation-spacing': 'error',
|
||||
}
|
||||
}
|
||||
]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user