Skip to content

Commit 896cee9

Browse files
authored
Eslint update. Dependabot config. (#39)
1 parent fa17cb4 commit 896cee9

File tree

15 files changed

+2364
-539
lines changed

15 files changed

+2364
-539
lines changed

.github/dependabot.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,48 @@
11
version: 2
22
updates:
3-
# Enable version updates for npm dependencies
3+
# Enable version updates for root dependencies
44
- package-ecosystem: "npm"
55
directory: "/" # Location of package.json file
66
schedule:
77
interval: "weekly"
8-
applies-to:
9-
- security-updates
8+
ignore:
9+
- dependency-type: "development"
1010
allow:
11-
- dependency-type: "production"
11+
- dependency-type: "all"
12+
update-types: ["security"]
13+
14+
# Enable version updates for devtools extension dependencies
15+
- package-ecosystem: "npm"
16+
directory: "/packages/vscode-messenger-devtools"
17+
schedule:
18+
interval: "weekly"
19+
ignore:
20+
- dependency-type: "development"
21+
allow:
22+
- dependency-type: "all"
23+
update-types: ["security"]
24+
25+
# Enable version updates for webview-ui dependencies
26+
- package-ecosystem: "npm"
27+
directory: "/packages/vscode-messenger-devtools/webview-ui"
28+
schedule:
29+
interval: "weekly"
30+
ignore:
31+
- dependency-type: "development"
32+
allow:
33+
- dependency-type: "all"
34+
update-types: ["security"]
1235

1336
# Enable version updates for GitHub Actions
1437
- package-ecosystem: "github-actions"
1538
directory: "/" # Location of GitHub Actions workflows
1639
schedule:
1740
interval: "weekly"
18-
applies-to:
19-
- security-updates
41+
ignore:
42+
- dependency-type: "development"
2043
allow:
21-
- dependency-type: "production"
44+
- dependency-type: "all"
45+
update-types: ["security"]
46+
labels:
47+
- "dependencies"
48+
- "github-actions"

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Node.js
1717
uses: actions/setup-node@v2
1818
with:
19-
node-version: '16'
19+
node-version: '18'
2020
- name: Build
2121
shell: bash
2222
run: |
Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
1-
{
2-
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"extends": [
5-
"eslint:recommended",
6-
"plugin:@typescript-eslint/recommended",
7-
"plugin:promise/recommended"
1+
const js = require("@eslint/js");
2+
const tsParser = require("@typescript-eslint/parser");
3+
const tsPlugin = require("@typescript-eslint/eslint-plugin");
4+
const promisePlugin = require("eslint-plugin-promise");
5+
const globals = require('globals');
6+
7+
module.exports = {
8+
files: [
9+
"**/*.ts",
10+
"**/*.tsx"
811
],
9-
"parserOptions": {
10-
"ecmaVersion": 6,
11-
"sourceType": "module"
12-
},
13-
"plugins": [
14-
"@typescript-eslint",
15-
"promise"
16-
],
17-
"ignorePatterns": [
18-
"**/{node_modules,lib,bin}"
12+
ignores: [
13+
// default ignores: ["**/node_modules/", ".git/"]
14+
"**/lib/",
15+
"**/out/"
1916
],
20-
"rules": {
17+
languageOptions: {
18+
parser: tsParser,
19+
parserOptions: {
20+
ecmaVersion: 6,
21+
sourceType: 'module'
22+
},
23+
},
24+
plugins: {
25+
"@typescript-eslint": tsPlugin,
26+
"promise": promisePlugin
27+
},
28+
rules: {
29+
...js.configs.recommended.rules,
30+
...promisePlugin.configs['flat/recommended'].rules,
31+
...tsPlugin.configs.recommended.rules,
2132
// List of [ESLint rules](https://eslint.org/docs/rules/)
33+
"no-undef": "off", // TypeScript checks this
2234
"arrow-parens": ["off", "as-needed"], // do not force arrow function parentheses
2335
"constructor-super": "error", // checks the correct use of super() in sub-classes
2436
"dot-notation": "error", // obj.a instead of obj['a'] when possible
@@ -32,7 +44,7 @@
3244
"no-eval": "error", // eval is considered unsafe
3345
"no-inner-declarations": "off", // we need to have 'namespace' functions when using TS 'export ='
3446
"no-labels": "error", // GOTO is only used in BASIC ;)
35-
"no-multiple-empty-lines": ["error", {"max": 1}], // two or more empty lines need to be fused to one
47+
"no-multiple-empty-lines": ["error", { "max": 1 }], // two or more empty lines need to be fused to one
3648
"no-new-wrappers": "error", // there is no reason to wrap primitve values
3749
"no-throw-literal": "error", // only throw Error but no objects {}
3850
"no-trailing-spaces": "error", // trim end of lines
@@ -51,21 +63,23 @@
5163
"@typescript-eslint/array-type": ["error", { // string[] instead of Array<string>
5264
"default": "array-simple"
5365
}],
54-
"@typescript-eslint/ban-types": "error", // bans types like String in favor of string
55-
"@typescript-eslint/indent": "error", // consistent indentation
66+
"@typescript-eslint/no-wrapper-object-types": "error", // bans types like String in favor of string
67+
68+
// FIXME now from @stylistic/indent plugin : "@typescript-eslint/indent": "error", // consistent indentation
5669
"@typescript-eslint/no-explicit-any": "error", // don't use :any type
5770
"@typescript-eslint/no-misused-new": "error", // no constructors for interfaces or new for classes
5871
"@typescript-eslint/no-namespace": "off", // disallow the use of custom TypeScript modules and namespaces
5972
"@typescript-eslint/no-non-null-assertion": "off", // allow ! operator
60-
"@typescript-eslint/no-parameter-properties": "error", // no property definitions in class constructors
73+
"@typescript-eslint/parameter-properties": "error", // no property definitions in class constructors
6174
"@typescript-eslint/no-unused-vars": ["error", { // disallow Unused Variables
6275
"argsIgnorePattern": "^_"
6376
}],
6477
"@typescript-eslint/no-var-requires": "error", // use import instead of require
6578
"@typescript-eslint/prefer-for-of": "error", // prefer for-of loop over arrays
6679
"@typescript-eslint/prefer-namespace-keyword": "error", // prefer namespace over module in TypeScript
6780
"@typescript-eslint/triple-slash-reference": "error", // ban /// <reference />, prefer imports
68-
"@typescript-eslint/type-annotation-spacing": "error", // consistent space around colon ':'
81+
// FIXME now from @stylistic/indent plugin : "@typescript-eslint/type-annotation-spacing": "error", // consistent space around colon ':'
6982
"@typescript-eslint/consistent-type-imports": "error"
7083
}
7184
}
85+
;

examples/calico-colors/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"build": "npm run compile",
7171
"vscode:prepublish": "npm run compile",
7272
"compile": "tsc -p ./ && npm run browserify",
73-
"lint": "eslint . --ext .ts,.tsx",
73+
"lint": "eslint src",
7474
"browserify": "browserify ./media/calico-colors/main.js > ./media/web-view-bundle-calico-colors.js && browserify ./media/coding-cat/main.js > ./media/web-view-bundle-coding-cat.js",
7575
"watch": "tsc -w -p ./"
7676
},

0 commit comments

Comments
 (0)