Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
feat: improve eslint config (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
bd82 authored Dec 22, 2020
1 parent fc8276f commit 74dd424
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
23 changes: 11 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
module.exports = {
// Common settings for JS Files.
extends: [
"eslint:recommended",
"plugin:eslint-comments/recommended",
// Disables all formatting related rules as formatting is handled by prettier, not eslint.
"prettier",
],
parserOptions: {
// The `ecmaVersion` should align to the supported features of our target runtimes (browsers / nodejs / others)
// Consult with: https://kangax.github.io/compat-table/es2016plus/
ecmaVersion: 2017,
},
extends: ["plugin:eslint-comments/recommended", "prettier"],
env: {
commonjs: true,
mocha: true,
Expand All @@ -23,15 +13,24 @@ module.exports = {
{
// For pure-java script sub-packages and general scripts (in any package).
files: ["*.js"],
extends: ["eslint:recommended"],
parserOptions: {
// The `ecmaVersion` should align to the supported features of our target runtimes (browsers / nodejs / others)
// Consult with: https://kangax.github.io/compat-table/es2016plus/
ecmaVersion: 2017,
},
},
{
// For sub-packages using TypeScript (libraries/VSCode Exts) && TypeScript definitions (d.ts)
files: ["*.ts"],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./tsconfig.base.json", "./tsconfig.json"],
},
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: {
"@typescript-eslint/no-use-before-define": [
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode_simple_ext/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { window } from "vscode";
import { multiply } from "@ecmascript_monorepo_template/npm_package_javascript_library";
import { add } from "@ecmascript_monorepo_template/npm_package_typescript_library";

export async function activate(): Promise<void> {
export function activate(): void {
const channel = window.createOutputChannel("vscode-simple_ext");
channel.appendLine("Hello Cruel World");
channel.appendLine(`two multiplied by three equals: ${multiply(2, 3)}`);
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"strict": true
},
"include": ["src/**/*", "api.d.ts"]
}
}
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"references": [
{
"path": "./packages/npm_package_javascript_library"
},
{
"path": "./packages/npm_package_typescript_library"
},
{
"path": "./packages/vscode_simple_ext"
}
],
"include": ["src/**/*"]
]
}

0 comments on commit 74dd424

Please sign in to comment.