@qlik/eslint-config 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,29 +33,8 @@ module.exports = {
33
33
 
34
34
  // modifies airbnb ts default rules
35
35
  "lines-between-class-members": "off",
36
- "@typescript-eslint/lines-between-class-members": "off",
37
-
38
- // discouraged https://palantir.github.io/tslint/rules/no-use-before-declare/
39
36
  "no-use-before-define": "off",
40
- "@typescript-eslint/no-use-before-define": "off",
41
-
42
37
  "dot-notation": "off",
43
- "@typescript-eslint/dot-notation": "off",
44
-
45
- "@typescript-eslint/prefer-ts-expect-error": "error",
46
- "@typescript-eslint/no-misused-promises": [
47
- "error",
48
- {
49
- checksConditionals: false,
50
- },
51
- ],
52
-
53
- // no-unsafe-* does not work good
54
- "@typescript-eslint/no-unsafe-call": "off",
55
- "@typescript-eslint/no-unsafe-member-access": "off",
56
- "@typescript-eslint/no-unsafe-return": "off",
57
- "@typescript-eslint/no-unsafe-argument": "off",
58
- "@typescript-eslint/no-unsafe-assignment": "off",
59
38
 
60
39
  // import plugin
61
40
  "import/prefer-default-export": "off",
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- extends: ["./airbnb-base.js"],
2
+ extends: ["./airbnb-base-mod.js"],
3
3
  rules: {
4
4
  // modifies airbnb rules for react
5
5
  "react/jsx-props-no-spreading": "off",
@@ -0,0 +1,32 @@
1
+ module.exports = {
2
+ extends: ["./airbnb-base-mod"],
3
+ rules: {
4
+ // modifies airbnb default rules
5
+ "no-undef": "off", // typescript handles these checks
6
+ // modifies airbnb ts default rules
7
+ "lines-between-class-members": "off",
8
+ "@typescript-eslint/lines-between-class-members": "off",
9
+
10
+ // discouraged https://palantir.github.io/tslint/rules/no-use-before-declare/
11
+ "no-use-before-define": "off",
12
+ "@typescript-eslint/no-use-before-define": "off",
13
+
14
+ "dot-notation": "off",
15
+ "@typescript-eslint/dot-notation": "off",
16
+
17
+ "@typescript-eslint/prefer-ts-expect-error": "error",
18
+ "@typescript-eslint/no-misused-promises": [
19
+ "error",
20
+ {
21
+ checksConditionals: false,
22
+ },
23
+ ],
24
+
25
+ // no-unsafe-* does not work good
26
+ "@typescript-eslint/no-unsafe-call": "off",
27
+ "@typescript-eslint/no-unsafe-member-access": "off",
28
+ "@typescript-eslint/no-unsafe-return": "off",
29
+ "@typescript-eslint/no-unsafe-argument": "off",
30
+ "@typescript-eslint/no-unsafe-assignment": "off",
31
+ },
32
+ };
@@ -0,0 +1,17 @@
1
+ module.exports = {
2
+ extends: ["./airbnb-ts-base-mod.js"],
3
+ rules: {
4
+ // modifies airbnb rules for react
5
+ "react/jsx-props-no-spreading": "off",
6
+ "react/jsx-uses-react": "off",
7
+ "react/react-in-jsx-scope": "off",
8
+ "react/forbid-prop-types": "off",
9
+ "react/function-component-definition": [
10
+ 2,
11
+ {
12
+ namedComponents: "arrow-function",
13
+ unnamedComponents: "arrow-function",
14
+ },
15
+ ],
16
+ },
17
+ };
package/configs/env.js ADDED
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ node: true,
5
+ es2022: true,
6
+ },
7
+ parserOptions: {
8
+ sourceType: "module",
9
+ ecmaVersion: "2022",
10
+ },
11
+ };
package/index.js CHANGED
@@ -1,22 +1,10 @@
1
1
  module.exports = {
2
2
  extends: [
3
3
  "eslint:recommended",
4
- "plugin:@typescript-eslint/recommended",
5
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
6
4
  "airbnb-base",
7
- "airbnb-typescript/base",
8
- "./mods/airbnb-base",
5
+ "./configs/airbnb-base-mod",
9
6
  "prettier",
7
+ "./overrides/ts",
8
+ "./configs/env",
10
9
  ],
11
- env: {
12
- browser: true,
13
- es2020: true,
14
- node: true,
15
- },
16
- plugins: ["@typescript-eslint"],
17
- parser: "@typescript-eslint/parser",
18
- parserOptions: {
19
- sourceType: "module",
20
- ecmaVersion: 2020,
21
- },
22
10
  };
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ overrides: [
3
+ {
4
+ files: ["*.js", "*.jsx"],
5
+ extends: ["airbnb", "../configs/airbnb-mod", "prettier", "../configs/env"],
6
+ },
7
+ {
8
+ files: ["*.ts", "*.tsx"],
9
+ extends: [
10
+ "plugin:@typescript-eslint/recommended",
11
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
12
+ "airbnb",
13
+ "airbnb-typescript",
14
+ "../configs/airbnb-ts-mod",
15
+ "prettier",
16
+ "../configs/env",
17
+ ],
18
+ plugins: ["@typescript-eslint"],
19
+ parser: "@typescript-eslint/parser",
20
+ },
21
+ ],
22
+ };
@@ -0,0 +1,30 @@
1
+ module.exports = {
2
+ overrides: [
3
+ {
4
+ files: ["*.svelte"],
5
+ extends: [
6
+ "plugin:@typescript-eslint/recommended",
7
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
8
+ "airbnb-base",
9
+ "airbnb-typescript/base",
10
+ "../configs/airbnb-ts-base-mod",
11
+ "plugin:svelte/recommended",
12
+ "plugin:svelte/prettier",
13
+ "prettier",
14
+ "../configs/env",
15
+ ],
16
+ parser: "svelte-eslint-parser",
17
+
18
+ parserOptions: {
19
+ parser: "@typescript-eslint/parser",
20
+ extraFileExtensions: [".svelte"],
21
+ },
22
+ rules: {
23
+ "no-undef-init": "off",
24
+ "no-unused-vars": "off",
25
+ "@typescript-eslint/no-unused-vars": "off",
26
+ "import/no-mutable-exports": "off",
27
+ },
28
+ },
29
+ ],
30
+ };
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ overrides: [
3
+ {
4
+ files: ["*.ts"],
5
+ extends: [
6
+ "plugin:@typescript-eslint/recommended",
7
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
8
+ "airbnb-base",
9
+ "airbnb-typescript/base",
10
+ "../configs/airbnb-ts-base-mod",
11
+ "prettier",
12
+ "../configs/env",
13
+ ],
14
+ plugins: ["@typescript-eslint"],
15
+ parser: "@typescript-eslint/parser",
16
+ },
17
+ ],
18
+ };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@qlik/eslint-config",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "Qlik's ESLint config for typescript",
5
5
  "repository": "git@github.com:qlik-oss/dev-tools-js.git",
6
6
  "license": "ISC",
7
7
  "main": "index.js",
8
8
  "files": [
9
- "mods",
9
+ "configs",
10
+ "overrides",
10
11
  "index.js",
11
12
  "node.js",
12
13
  "esm.js",
@@ -25,8 +26,8 @@
25
26
  "extends": "eslint:recommended"
26
27
  },
27
28
  "dependencies": {
28
- "@typescript-eslint/eslint-plugin": "5.59.7",
29
- "@typescript-eslint/parser": "5.59.7",
29
+ "@typescript-eslint/eslint-plugin": "5.59.8",
30
+ "@typescript-eslint/parser": "5.59.8",
30
31
  "eslint-config-airbnb": "19.0.4",
31
32
  "eslint-config-airbnb-base": "15.0.0",
32
33
  "eslint-config-airbnb-typescript": "17.0.0",
@@ -36,21 +37,21 @@
36
37
  "eslint-plugin-playwright": "0.12.0",
37
38
  "eslint-plugin-react": "7.32.2",
38
39
  "eslint-plugin-react-hooks": "4.6.0",
39
- "eslint-plugin-svelte": "2.29.0",
40
- "eslint-plugin-vitest": "0.2.3",
41
- "svelte-eslint-parser": "0.29.0"
40
+ "eslint-plugin-svelte": "2.30.0",
41
+ "eslint-plugin-vitest": "0.2.5",
42
+ "svelte-eslint-parser": "0.30.0"
42
43
  },
43
44
  "devDependencies": {
44
- "eslint": "8.41.0",
45
+ "eslint": "8.42.0",
45
46
  "prettier": "2.8.8",
46
- "@qlik/prettier-config": "0.1.2"
47
+ "@qlik/prettier-config": "0.1.3"
47
48
  },
48
49
  "peerDependencies": {
49
50
  "eslint": "*"
50
51
  },
51
52
  "optionalDependencies": {
52
53
  "svelte": "^3.59.1",
53
- "typescript": "^5.0.4"
54
+ "typescript": "^5.1.3"
54
55
  },
55
56
  "engines": {
56
57
  "node": ">=16",
package/react-svelte.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- extends: ["./react", "./mods/svelte"],
2
+ extends: ["./index", "./overrides/react", "./overrides/svelte"],
3
3
  };
package/react.js CHANGED
@@ -1,22 +1,3 @@
1
1
  module.exports = {
2
- extends: [
3
- "eslint:recommended",
4
- "plugin:@typescript-eslint/recommended",
5
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
6
- "airbnb",
7
- "airbnb-typescript",
8
- "./mods/airbnb",
9
- "prettier",
10
- ],
11
- env: {
12
- browser: true,
13
- es2020: true,
14
- node: true,
15
- },
16
- plugins: ["@typescript-eslint"],
17
- parser: "@typescript-eslint/parser",
18
- parserOptions: {
19
- sourceType: "module",
20
- ecmaVersion: 2020,
21
- },
2
+ extends: ["./index", "./overrides/react"],
22
3
  };
package/svelte.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- extends: ["./index", "./mods/svelte"],
2
+ extends: ["./index", "./overrides/svelte"],
3
3
  };
package/mods/svelte.js DELETED
@@ -1,21 +0,0 @@
1
- module.exports = {
2
- extends: ["plugin:svelte/recommended", "plugin:svelte/prettier"],
3
- parserOptions: {
4
- extraFileExtensions: [".svelte"],
5
- },
6
- overrides: [
7
- {
8
- files: ["*.svelte"],
9
- parser: "svelte-eslint-parser",
10
- parserOptions: {
11
- parser: "@typescript-eslint/parser",
12
- },
13
- rules: {
14
- "no-undef-init": "off",
15
- "no-unused-vars": "off",
16
- "@typescript-eslint/no-unused-vars": "off",
17
- "import/no-mutable-exports": "off",
18
- },
19
- },
20
- ],
21
- };