add linter for checking license headers (and eslint --fix target to match, and fix missing license headers while we're here) (#62)

This commit is contained in:
Tyler
2025-04-20 17:16:25 -07:00
committed by GitHub
parent 305ed41b88
commit d55168f51f
8 changed files with 72 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import reactHooks from 'eslint-plugin-react-hooks';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import globals from 'globals';
import licenseHeader from 'eslint-plugin-license-header';
export default tseslint.config(
{
@@ -142,6 +143,24 @@ export default tseslint.config(
'default-case': 'error',
},
},
{
files: ['./**/*.{tsx,ts,js}'],
plugins: {
'license-header': licenseHeader,
},
rules: {
'license-header/header': [
'error',
[
'/**',
' * @license',
' * Copyright 2025 Google LLC',
' * SPDX-License-Identifier: Apache-2.0',
' */',
],
],
},
},
// Prettier config must be last
prettierConfig,
);