Skip to content

Commit

Permalink
Added license headers jest linter.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Jun 4, 2024
1 parent 0fcf9f7 commit bcd1633
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
19 changes: 18 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import path from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'
import pluginJs from '@eslint/js'
import licenseHeader from 'eslint-plugin-license-header'

// mimic CommonJS variables -- not needed if using CommonJS
const _filename = fileURLToPath(import.meta.url)
Expand All @@ -13,6 +14,9 @@ export default [
...compat.extends('standard-with-typescript'),
{
files: ['**/*.{js,ts}'],
plugins: {
'license-header': licenseHeader
},
rules: {
'@typescript-eslint/consistent-indexed-object-style': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
Expand Down Expand Up @@ -51,7 +55,20 @@ export default [
'array-callback-return': 'off',
'new-cap': 'off',
'no-return-assign': 'error',
'object-shorthand': 'error'
'object-shorthand': 'error',
'license-header/header': [
'error',
[
'/*',
'* Copyright OpenSearch Contributors',
'* SPDX-License-Identifier: Apache-2.0',
'*',
'* The OpenSearch Contributors require contributions made to',
'* this file be licensed under the Apache-2.0 license or a',
'* compatible open source license.',
'*/'
]
]
}
}
]
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"eslint": "^8.57.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-license-header": "^0.6.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"globals": "^15.0.0",
Expand Down

0 comments on commit bcd1633

Please sign in to comment.