UNPKG

eslint-config-kentcdodds

Version:

ESLint rules according to kentcdodds' personal preference

91 lines (89 loc) 2.89 kB
/** * @see https://github.com/eslint/eslint/issues/3458 * @see https://www.npmjs.com/package/@rushstack/eslint-patch */ require('@rushstack/eslint-patch/modern-module-resolution') module.exports = { env: { es6: true, }, parserOptions: { ecmaVersion: 2018, sourceType: 'module', }, plugins: ['import'], settings: { 'import/ignore': ['node_modules', '.json$', '.(scss|less|css|styl)$'], }, rules: { 'import/consistent-type-specifier-style': ['error', 'prefer-inline'], 'import/default': 'error', 'import/dynamic-import-chunkname': 'off', 'import/export': 'error', 'import/exports-last': 'off', 'import/extensions': 'off', 'import/first': 'error', 'import/group-exports': 'off', 'import/max-dependencies': 'off', 'import/named': 'error', 'import/namespace': 'error', 'import/newline-after-import': 'off', 'import/no-absolute-path': 'error', 'import/no-amd': 'error', 'import/no-anonymous-default-export': 'off', 'import/no-commonjs': 'off', 'import/no-cycle': 'off', // this rule is quite slow... 'import/no-default-export': 'off', 'import/no-deprecated': 'warn', // this is an in progress rule 'import/no-duplicates': 'error', 'import/no-dynamic-require': 'off', 'import/no-empty-named-blocks': 'error', 'import/no-extraneous-dependencies': 'error', 'import/no-import-module-exports': 'error', 'import/no-internal-modules': 'off', 'import/no-mutable-exports': 'error', 'import/no-named-as-default': 'error', 'import/no-named-as-default-member': 'error', 'import/no-named-default': 'error', 'import/no-named-export': 'off', // Prohibit named exports. Mostly an inverse of no-default-export 'import/no-namespace': 'off', 'import/no-nodejs-modules': 'off', 'import/no-relative-packages': 'warn', 'import/no-relative-parent-imports': 'off', 'import/no-restricted-paths': 'off', 'import/no-self-import': 'error', 'import/no-unassigned-import': 'off', 'import/no-unresolved': 'error', 'import/no-unused-modules': 'off', 'import/no-useless-path-segments': 'off', 'import/no-webpack-loader-syntax': 'error', 'import/order': [ 'warn', { groups: [ 'builtin', ['external', 'internal'], 'parent', ['sibling', 'index'], ], }, ], 'import/prefer-default-export': 'off', 'import/unambiguous': 'off', // not sure I understand this rule well enough right now... }, overrides: [ { files: ['**/*.ts?(x)'], extends: 'plugin:import/typescript', parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 2018, sourceType: 'module', }, plugins: ['@typescript-eslint'], rules: { 'import/no-unresolved': 'off', // ts(2307) }, }, ], }