ci: Use eslint-plugin-diff only on the CI (#4194)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2022-09-26 14:43:52 +02:00 committed by GitHub
parent a4f9f041a0
commit bc42073e28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
/** /**
* @type {import('@types/eslint').ESLint.ConfigData} * @type {import('@types/eslint').ESLint.ConfigData}
*/ */
module.exports = { const config = module.exports = {
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
parserOptions: { parserOptions: {
sourceType: 'module', sourceType: 'module',
@ -34,13 +34,6 @@ module.exports = {
*/ */
'eslint-plugin-prettier', 'eslint-plugin-prettier',
/**
* Plugin to lint only changes
*
* https://github.com/paleite/eslint-plugin-diff#plugindiffdiff-recommended
*/
'eslint-plugin-diff',
/* /*
* Plugin to allow specifying local ESLint rules. * Plugin to allow specifying local ESLint rules.
* https://github.com/ivov/eslint-plugin-n8n-local-rules * https://github.com/ivov/eslint-plugin-n8n-local-rules
@ -77,13 +70,6 @@ module.exports = {
* https://github.com/prettier/eslint-config-prettier * https://github.com/prettier/eslint-config-prettier
*/ */
'eslint-config-prettier', 'eslint-config-prettier',
/**
* Config for eslint-plugin-diff
*
* https://github.com/paleite/eslint-plugin-diff#plugindiffdiff-recommended
*/
'plugin:diff/diff',
], ],
rules: { rules: {
@ -385,3 +371,19 @@ module.exports = {
'import/prefer-default-export': 'off', 'import/prefer-default-export': 'off',
}, },
}; };
if ('ESLINT_PLUGIN_DIFF_COMMIT' in process.env) {
/**
* Plugin to lint only changes
*
* https://github.com/paleite/eslint-plugin-diff#plugindiffdiff-recommended
*/
config.plugins.push('eslint-plugin-diff');
/**
* Config for eslint-plugin-diff
*
* https://github.com/paleite/eslint-plugin-diff#plugindiffdiff-recommended
*/
config.extends.push('plugin:diff/diff');
}