Skip to content

Commit

Permalink
Implement linting
Browse files Browse the repository at this point in the history
  • Loading branch information
boaz-codota committed Oct 28, 2020
1 parent 3923851 commit 67a8077
Show file tree
Hide file tree
Showing 37 changed files with 662 additions and 442 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
dist
out
# don't lint nyc coverage output
coverage
coverage
.eslintrc.js
37 changes: 24 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2021: true,
},
extends: [
"airbnb-typescript",
"airbnb-typescript/base",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/typescript",
"prettier",
"prettier/@typescript-eslint",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
impliedStrict: true,
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
plugins: ["@typescript-eslint", "import"],
rules: {
"no-void": "off",
"no-console": "off",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ["src/test/**/*.ts"],
},
],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowAny: true,
allowNumber: true,
allowBoolean: true,
allowNullish: false,
},
],
"@typescript-eslint/no-use-before-define": [
"error",
{ functions: false, classes: false },
Expand All @@ -37,16 +55,9 @@ module.exports = {
],
},
settings: {
node: {
tryExtensions: [".js", ".json", ".node", ".ts", ".d.ts"],
},
"import/parsers": {
"@typescript-eslint/parser": [".ts"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
project: "tsconfig.json",
alwaysTryTypes: true,
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/continues_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
- name: Lint
run: npm run lint
- name: Package
run: npm run vsce:package
Loading

0 comments on commit 67a8077

Please sign in to comment.