renovate/.eslintrc.js

187 строки
5.1 KiB
JavaScript
Исходник Обычный вид История

Add eslint Closes #17 commit 12d7e50a818720ff2c44e4e9475eef78a1dc0174 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 22:27:56 2017 +0100 Update eslintrc commit f583442dcdf7e3180d2da5464693df12f4419152 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 22:22:15 2017 +0100 Add eslint and config commit 59334f7a7311c451ef7aa4e0759d9c09686e86c6 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 22:20:24 2017 +0100 Refactor promise for linting commit 288f0e753a3d1e93f1b14e3e80692861fab0fff0 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 19:09:48 2017 +0100 Fix more promise lints commit 7f602a149c60da123bc010965ec8be78b3fa7ab1 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 18:30:18 2017 +0100 lint github promises commit dd6b78340e5a9c128e83aa87da8e3714e3947e82 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 18:30:10 2017 +0100 lint npm promises commit 5c48c159c7ab89999e7966d93c4b1c9f1179d95d Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:25:13 2017 +0100 Lint packageJson helper commit b440eb83fccdc2c1afbd3e3b74c6798e35b3533f Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:04:56 2017 +0100 Fix github helper lint commit 269c84a2be8a2e9cd495d4f90893eaaccd8a2156 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:00:48 2017 +0100 Fix typo commit 548ca6c31f3f4417995c65f4466d216a4918387e Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:00:29 2017 +0100 Fix npm lint commit f8ea5d5b72745e7cbebad184f46fc3046f57a525 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:56:15 2017 +0100 lint defaults commit 6130092a57d37d62ed8f1274817ce81dfdae84bc Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:52:16 2017 +0100 Finish index commit 9e2b6f5e02fad38904172b40811043a0caab879b Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:40:06 2017 +0100 Fix string concatenation commit 47b7cdac3f0acc6588e403dff3cacfda27789472 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:38:23 2017 +0100 Fix arrow syntax commit 27b8db685f7ee66e914754fd578d421f39656397 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:29:10 2017 +0100 Refactor updateDependency commit 272f012583ac514709c81ffd7a68f50f0b4ed2b3 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:15:43 2017 +0100 Refactor ensureCommit commit 1e1ff56d6b94a8ef6a360213715563452a0957e8 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 13:54:02 2017 +0100 Refactor ensurePr
2017-01-11 00:28:22 +03:00
module.exports = {
root: true,
env: {
node: true,
},
plugins: ['@renovate'],
2019-07-08 16:58:12 +03:00
extends: [
2021-11-08 16:03:55 +03:00
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:jest/recommended',
'plugin:jest/style',
2020-02-12 12:22:38 +03:00
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/src/configs
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:promise/recommended',
2019-07-08 16:58:12 +03:00
'prettier',
],
parserOptions: {
2019-05-21 18:23:30 +03:00
ecmaVersion: 9,
tsconfigRootDir: __dirname,
project: ['./tsconfig.lint.json'],
extraFileExtensions: ['.mjs'],
},
rules: {
/*
* checks done by typescript.
*
* https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
* required for esm check
*/
'import/default': 2,
'import/named': 2,
'import/namespace': 2,
'import/no-named-as-default-member': 0,
2021-11-09 09:30:22 +03:00
'import/prefer-default-export': 0, // no benefit
// other rules
2021-11-09 09:37:22 +03:00
'consistent-return': 'error',
eqeqeq: 'error',
2021-11-09 09:48:31 +03:00
'no-console': 'error',
'no-negated-condition': 'error',
2021-11-09 09:30:22 +03:00
'no-param-reassign': 'error',
'no-template-curly-in-string': 'error',
2020-05-01 19:03:48 +03:00
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true, // conflicts with our other import ordering rules
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
// mdast is a types only package `@types/mdast`
'import/no-unresolved': ['error', { ignore: ['^mdast$'] }],
2020-05-01 19:03:48 +03:00
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
},
],
2021-06-16 10:13:33 +03:00
// disallow direct `nock` module usage as it causes memory issues.
'no-restricted-imports': [2, { paths: ['nock'] }],
2020-10-20 09:49:28 +03:00
// Makes no sense to allow type inference for expression parameters, but require typing the response
'@typescript-eslint/explicit-function-return-type': [
'error',
{ allowExpressions: true, allowTypedFunctionExpressions: true },
],
2019-07-08 16:58:12 +03:00
// TODO: fix lint
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 2,
2019-07-17 11:14:56 +03:00
'@typescript-eslint/no-unused-vars': [
2,
2019-07-17 11:14:56 +03:00
{
vars: 'all',
args: 'none',
ignoreRestSiblings: false,
2019-07-08 16:58:12 +03:00
},
],
'@typescript-eslint/prefer-optional-chain': 2,
'@typescript-eslint/prefer-nullish-coalescing': 2,
curly: [2, 'all'],
2020-07-22 08:45:57 +03:00
'require-await': 2,
// next 2 rules disabled due to https://github.com/microsoft/TypeScript/issues/20024
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
// TODO: fix me
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-unsafe-argument': 0, // thousands of errors :-/
'@typescript-eslint/restrict-template-expressions': [
1,
{ allowNumber: true, allowBoolean: true },
],
'@typescript-eslint/restrict-plus-operands': 2,
2021-11-08 16:03:55 +03:00
'@typescript-eslint/naming-convention': [
2,
{
selector: 'enumMember',
format: ['PascalCase'],
},
],
'@typescript-eslint/unbound-method': 2,
'@typescript-eslint/ban-types': 2,
'@renovate/jest-root-describe': 2,
2019-07-17 11:14:56 +03:00
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
},
overrides: [
{
// files to check, so no `--ext` is required
files: ['**/*.{js,mjs,cjs,ts}'],
},
{
files: ['**/*.spec.ts', 'test/**'],
env: {
jest: true,
},
rules: {
'no-template-curly-in-string': 0,
'prefer-destructuring': 0,
'prefer-promise-reject-errors': 0,
'import/no-dynamic-require': 0,
'global-require': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-object-literal-type-assertion': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/unbound-method': 0,
'jest/valid-title': [0, { ignoreTypeOfDescribeName: true }],
'max-classes-per-file': 0,
'class-methods-use-this': 0,
},
},
2020-03-11 12:11:01 +03:00
{
files: ['**/*.{js,mjs,cjs}'],
2020-03-11 12:11:01 +03:00
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/restrict-template-expressions': 0,
2020-03-11 12:11:01 +03:00
},
},
2021-08-27 16:58:50 +03:00
{
files: ['tools/**/*.{ts,js,mjs,cjs}'],
2021-08-27 16:58:50 +03:00
env: {
node: true,
},
rules: {
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: true },
],
},
},
{
files: ['tools/**/*.{js,cjs}', 'bin/*.{js,cjs}'],
2021-08-27 16:58:50 +03:00
rules: {
// need commonjs
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.mjs'],
rules: {
// esm always requires extensions
'import/extensions': 0,
},
},
],
Add eslint Closes #17 commit 12d7e50a818720ff2c44e4e9475eef78a1dc0174 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 22:27:56 2017 +0100 Update eslintrc commit f583442dcdf7e3180d2da5464693df12f4419152 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 22:22:15 2017 +0100 Add eslint and config commit 59334f7a7311c451ef7aa4e0759d9c09686e86c6 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 22:20:24 2017 +0100 Refactor promise for linting commit 288f0e753a3d1e93f1b14e3e80692861fab0fff0 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 19:09:48 2017 +0100 Fix more promise lints commit 7f602a149c60da123bc010965ec8be78b3fa7ab1 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 18:30:18 2017 +0100 lint github promises commit dd6b78340e5a9c128e83aa87da8e3714e3947e82 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 18:30:10 2017 +0100 lint npm promises commit 5c48c159c7ab89999e7966d93c4b1c9f1179d95d Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:25:13 2017 +0100 Lint packageJson helper commit b440eb83fccdc2c1afbd3e3b74c6798e35b3533f Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:04:56 2017 +0100 Fix github helper lint commit 269c84a2be8a2e9cd495d4f90893eaaccd8a2156 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:00:48 2017 +0100 Fix typo commit 548ca6c31f3f4417995c65f4466d216a4918387e Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 15:00:29 2017 +0100 Fix npm lint commit f8ea5d5b72745e7cbebad184f46fc3046f57a525 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:56:15 2017 +0100 lint defaults commit 6130092a57d37d62ed8f1274817ce81dfdae84bc Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:52:16 2017 +0100 Finish index commit 9e2b6f5e02fad38904172b40811043a0caab879b Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:40:06 2017 +0100 Fix string concatenation commit 47b7cdac3f0acc6588e403dff3cacfda27789472 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:38:23 2017 +0100 Fix arrow syntax commit 27b8db685f7ee66e914754fd578d421f39656397 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:29:10 2017 +0100 Refactor updateDependency commit 272f012583ac514709c81ffd7a68f50f0b4ed2b3 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 14:15:43 2017 +0100 Refactor ensureCommit commit 1e1ff56d6b94a8ef6a360213715563452a0957e8 Author: Rhys Arkins <rhys@keylocation.sg> Date: Tue Jan 10 13:54:02 2017 +0100 Refactor ensurePr
2017-01-11 00:28:22 +03:00
};