Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate eslint with eslint-config-standard #385

Merged
merged 6 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const path = require('path');
const headerDef = path.resolve(__dirname, './packages/config/header.js');

module.exports = {
env: {
browser: true,
es2020: true
},
extends: 'standard',
globals: {
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: '2020',
sourceType: 'module'
},
plugins: [
'@typescript-eslint',
'import',
'unused-imports',
'header'
],
rules: {
indent: ['error', 4, {
SwitchCase: 1
}],
semi: ['error', 'always'],
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': ['error'],
'no-dupe-class-members': 'off',
CGNonofr marked this conversation as resolved.
Show resolved Hide resolved
'@typescript-eslint/no-dupe-class-members': ['error'],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': ['error'],
'no-useless-constructor': 'warn',
'no-void': 'warn',
// Following recommendation:
// https://typescript-eslint.io/docs/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_'
}],
'header/header': [2, headerDef]
},
ignorePatterns: ['.eslintrc.js', './packages/examples/browser-lsp/src/serverWorker.ts']
};
4 changes: 3 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ jobs:
- name: Build
shell: bash
run: |
npm i && npm run build
npm ci
npm run build
npm run lint
CGNonofr marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"editor.formatOnSave": false,
"workbench.editor.revealIfOpen": true,
"[javascript]": {
"editor.formatOnSave": true
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.formatOnSave": true
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"eslint.validate": [
"javascript",
Expand Down
Loading