Skip to content

Commit

Permalink
Add lint, lint:fix commands (#17)
Browse files Browse the repository at this point in the history
* Adding eslint, typescript-eslint

* Add eslint header plugin

* Add to ci.yml, ban warnings

* Add @Stylistic plugin for basic formatting checks

* Cleanup lint commands

* Downgrade eslint for better editor support with legacy config
  • Loading branch information
mvirgil authored Oct 23, 2024
1 parent a25a0b7 commit 4fe94ef
Show file tree
Hide file tree
Showing 11 changed files with 1,675 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
.eslintrc.js
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
env: {
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true
},
plugins: [
'@stylistic',
'@typescript-eslint',
'header',
],
root: true,
rules: {
'@stylistic/array-bracket-spacing': [ 'error', 'always' ],
'@stylistic/indent': [ 'error', 2 ],
'@stylistic/object-curly-spacing': [ 'error', 'always' ],
'@stylistic/quotes': [ 'error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true } ],
'@stylistic/semi': 'error',
'header/header': [2, 'block', [
'',
' * Copyright Splunk Inc.',
' *',
' * Licensed under the Apache License, Version 2.0 (the "License");',
' * you may not use this file except in compliance with the License.',
' * You may obtain a copy of the License at',
' *',
' * http://www.apache.org/licenses/LICENSE-2.0',
' *',
' * Unless required by applicable law or agreed to in writing, software',
' * distributed under the License is distributed on an "AS IS" BASIS,',
' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.',
' * See the License for the specific language governing permissions and',
' * limitations under the License.',
''
], 2],
}
};
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ jobs:
run: npm ci
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Unit tests
run: npm run test:unit
Loading

0 comments on commit 4fe94ef

Please sign in to comment.