From 1a62f157787d183d5118a45f600d5574a59c8c12 Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sun, 31 Oct 2021 17:08:01 +0100 Subject: [PATCH] Switch to .xo-config.cjs --- .xo-config.cjs | 91 +++++++++++++++++++++++++++++++++++++++++++++++++ .xo-config.json | 91 ------------------------------------------------- 2 files changed, 91 insertions(+), 91 deletions(-) create mode 100644 .xo-config.cjs delete mode 100644 .xo-config.json diff --git a/.xo-config.cjs b/.xo-config.cjs new file mode 100644 index 000000000..3ef0fe052 --- /dev/null +++ b/.xo-config.cjs @@ -0,0 +1,91 @@ +module.exports = { + ignores: [ + 'media/**', + 'test/config/fixtures/config-errors/test.js', + 'test/line-numbers/fixtures/line-numbers.js', + 'test-tap/fixture/snapshots/test-sourcemaps/build/**', + 'test-tap/fixture/report/edgecases/ast-syntax-error.cjs', + 'examples/typescript-*/**/*.ts', + ], + rules: { + 'import/order': [ + 'error', + { + alphabetize: { + order: 'asc', + }, + 'newlines-between': 'always', + }, + ], + 'import/newline-after-import': 'error', + 'unicorn/require-post-message-target-origin': 'off', + }, + overrides: [ + { + files: [ + 'index.d.ts', + 'types/*.d.ts', + ], + rules: { + 'import/extensions': 'off', + }, + }, + { + files: 'plugin.d.ts', + rules: { + 'node/prefer-global/url': 'off', + }, + }, + { + files: '{test,test-{d,tap}}/**/*.ts', + rules: { + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/prefer-readonly-parameter-types': 'off', + }, + }, + { + files: '{test,test-{d,tap}}/**', + rules: { + 'import/no-anonymous-default-export': 'off', + 'node/prefer-global/buffer': 'off', + 'node/prefer-global/process': 'off', + }, + }, + { + files: 'test-tap/**', + rules: { + 'promise/prefer-await-to-then': 'off', + 'unicorn/error-message': 'off', + 'unicorn/no-array-reduce': 'off', + 'unicorn/prevent-abbreviations': 'off', + }, + }, + { + files: 'test/macros/fixtures/macros.js', + rules: { + 'ava/no-identical-title': 'off', + }, + }, + { + files: [ + 'examples/**', + 'test/snapshot-*/fixtures/**', + ], + rules: { + 'unicorn/prefer-module': 'off', + }, + }, + { + files: 'examples/**', + rules: { + 'ava/no-only-test': 'off', + }, + }, + ], +}; diff --git a/.xo-config.json b/.xo-config.json deleted file mode 100644 index 56282e412..000000000 --- a/.xo-config.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "ignores": [ - "media/**", - "test/config/fixtures/config-errors/test.js", - "test/line-numbers/fixtures/line-numbers.js", - "test-tap/fixture/snapshots/test-sourcemaps/build/**", - "test-tap/fixture/report/edgecases/ast-syntax-error.cjs", - "examples/typescript-*/**/*.ts" - ], - "rules": { - "import/order": [ - "error", - { - "alphabetize": { - "order": "asc" - }, - "newlines-between": "always" - } - ], - "import/newline-after-import": "error", - "unicorn/require-post-message-target-origin": "off" - }, - "overrides": [ - { - "files": [ - "index.d.ts", - "types/*.d.ts" - ], - "rules": { - "import/extensions": "off" - } - }, - { - "files": "plugin.d.ts", - "rules": { - "node/prefer-global/url": "off" - } - }, - { - "files": "{test,test-{d,tap}}/**/*.ts", - "rules": { - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-return": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/prefer-readonly-parameter-types": "off" - } - }, - { - "files": "{test,test-{d,tap}}/**", - "rules": { - "import/no-anonymous-default-export": "off", - "node/prefer-global/buffer": "off", - "node/prefer-global/process": "off" - } - }, - { - "files": "test-tap/**", - "rules": { - "promise/prefer-await-to-then": "off", - "unicorn/error-message": "off", - "unicorn/no-array-reduce": "off", - "unicorn/prevent-abbreviations": "off" - } - }, - { - "files": "test/macros/fixtures/macros.js", - "rules": { - "ava/no-identical-title": "off" - } - }, - { - "files": [ - "examples/**", - "test/snapshot-*/fixtures/**" - ], - "rules": { - "unicorn/prefer-module": "off" - } - }, - { - "files": "examples/**", - "rules": { - "ava/no-only-test": "off" - } - } - ] -}