1+ /**
2+ * Copyright 2026 GitProxy Contributors
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
117// @ts -check
218import { fileURLToPath } from 'node:url' ;
319import { includeIgnoreFile } from '@eslint/compat' ;
@@ -9,6 +25,7 @@ import react from 'eslint-plugin-react';
925import json from '@eslint/json' ;
1026import cypress from 'eslint-plugin-cypress' ;
1127import prettierConfig from 'eslint-config-prettier/flat' ;
28+ import licenseHeader from 'eslint-plugin-license-header' ;
1229
1330// paths shouldn't start with ./
1431
@@ -20,6 +37,13 @@ const gitignorePath = fileURLToPath(
2037 ) ,
2138) ;
2239
40+ const licenseHeaderPath = fileURLToPath (
41+ new URL (
42+ 'licenseHeader.js' ,
43+ import . meta. url ,
44+ ) ,
45+ ) ;
46+
2347export default defineConfig (
2448 includeIgnoreFile ( gitignorePath , 'Imported .gitignore patterns' ) ,
2549 {
@@ -164,6 +188,16 @@ export default defineConfig(
164188 } ,
165189 } ,
166190
191+ {
192+ name : 'license-header' ,
193+ files : [ '**/*.{js,jsx,mjs,cjs,ts,tsx}' ] ,
194+ plugins : { 'license-header' : licenseHeader } ,
195+ rules : {
196+ 'license-header/header' : [ 'error' , licenseHeaderPath ] ,
197+ } ,
198+ ignores : [ '**/licenseHeader.js' ] ,
199+ } ,
200+
167201 // disables rules which prettier controls
168202 // https://prettier.io/docs/integrating-with-linters
169203 prettierConfig ,
0 commit comments