// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ /** * @fileoverview Enforce presence of Zammad copyright header * @author Martin Gruner */ //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** * @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { type: 'problem', docs: { description: 'Enforce presence of Zammad copyright header', category: 'Layout & Formatting', recommended: true, url: null, }, fixable: 'code', schema: [], }, create(context) { const year = new Date().getYear() + 1900 let expectedComment = `// Copyright (C) 2012-${year} Zammad Foundation, https://zammad-foundation.org/` let findComment = '// Copyright' if (context.getFilename().endsWith('.vue')) { expectedComment = `` findComment = '