@asgardeo/auth-react 0.2.5 → 0.2.9

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.
package/.eslintrc.js CHANGED
@@ -1,74 +1,166 @@
1
+ /**
2
+ * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
3
+ *
4
+ * WSO2 Inc. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ *
18
+ */
19
+
20
+ // Base ESLint Config which can be extended to be used in the development environment.
21
+
1
22
  module.exports = {
2
- env: {
3
- browser: true,
4
- es6: true,
5
- jest: true,
6
- node: true
23
+ extends: [
24
+ "eslint:recommended",
25
+ "plugin:react/recommended",
26
+ "plugin:import/typescript",
27
+ "plugin:react-hooks/recommended"
28
+ ],
29
+ globals: {
30
+ JSX: false,
31
+ // no-undef complains about globalThis @see {@link https://github.com/eslint/eslint/issues/11553}
32
+ globalThis: false
7
33
  },
8
- extends: ["eslint:recommended", "plugin:import/typescript"],
9
- overrides: [{
10
- env: {
11
- browser: true,
12
- es6: true,
13
- node: true
14
- },
15
- extends: [
16
- "eslint:recommended",
17
- "plugin:@typescript-eslint/eslint-recommended",
18
- "plugin:@typescript-eslint/recommended",
19
- 'plugin:react/recommended'
20
- ],
21
- files: ["**/*.tsx", "**/*.ts"],
22
- parser: "@typescript-eslint/parser",
23
- parserOptions: {
24
- ecmaVersion: 9,
25
- sourceType: "module"
26
- },
27
- rules: {
28
- "@typescript-eslint/explicit-function-return-type": 0,
29
- "@typescript-eslint/no-explicit-any": 0,
30
- "@typescript-eslint/no-inferrable-types": "off",
31
- "@typescript-eslint/no-use-before-define": ["warn", {
32
- classes: false,
33
- functions: false,
34
- typedefs: false,
35
- variables: false
36
- }],
37
- "eol-last": "error",
38
- "no-use-before-define": "off"
39
- }
40
- }],
41
34
  parserOptions: {
42
35
  ecmaVersion: 9,
43
36
  sourceType: "module"
44
37
  },
45
- plugins: ["import"],
38
+ plugins: [ "import" ],
39
+ settings: {
40
+ react: {
41
+ version: "detect"
42
+ }
43
+ },
44
+ env: {
45
+ browser: true,
46
+ jest: true,
47
+ node: true,
48
+ es6: true
49
+ },
50
+ root: true,
46
51
  rules: {
47
- "comma-dangle": ["warn", "never"],
48
52
  "eol-last": "error",
49
- "import/order": ["warn", {
50
- "alphabetize": {
51
- caseInsensitive: true,
52
- order: "asc"
53
- },
54
- "groups": ["builtin", "external", "index", "sibling", "parent", "internal"]
55
- }],
56
- "max-len": ["warn", {
57
- "code": 120
58
- }],
59
- "no-console": "warn",
60
- "no-duplicate-imports": "warn",
61
- "object-curly-spacing": ["warn", "always"],
62
- "quotes": ["warn", "double"],
63
- "sort-imports": ["warn", {
53
+ "quotes": [ "warn", "double" ],
54
+ "max-len": [ "warn", { "code": 120 } ],
55
+ "comma-dangle": [ "warn", "never" ],
56
+ "sort-imports": [ "warn", {
64
57
  "ignoreCase": false,
65
58
  "ignoreDeclarationSort": true,
66
59
  "ignoreMemberSort": false
67
- }],
68
- "sort-keys": ["warn", "asc", {
69
- "caseSensitive": true,
70
- "minKeys": 2,
71
- "natural": false
72
- }]
73
- }
60
+ } ],
61
+ "import/order": [
62
+ "warn",
63
+ {
64
+ "groups": [ "builtin", "external", "index", "sibling", "parent", "internal" ],
65
+ "alphabetize": {
66
+ order: "asc",
67
+ caseInsensitive: true
68
+ }
69
+ }
70
+ ],
71
+ "react/jsx-curly-spacing": [
72
+ "warn",
73
+ {
74
+ when: "always",
75
+ children: { "when": "always" },
76
+ allowMultiline: true,
77
+ spacing: { objectLiterals: "always" }
78
+ }
79
+ ],
80
+ "no-unused-vars": 1,
81
+ "react-hooks/exhaustive-deps": [ "off" ],
82
+ "react/no-children-prop": 0,
83
+ "react/display-name": 0,
84
+ "react/prop-types": 1,
85
+ "sort-keys": [ "warn", "asc", { "caseSensitive": true, "natural": false, "minKeys": 2 } ],
86
+ "object-curly-spacing": [ "warn", "always" ],
87
+ "no-console": "warn",
88
+ "no-duplicate-imports": "warn",
89
+ "no-restricted-imports": [
90
+ "error",
91
+ {
92
+ paths: [
93
+ {
94
+ message: "Please use import foo from 'lodash-es/foo' instead.",
95
+ name: "lodash"
96
+ },
97
+ {
98
+ message: "Avoid using chain since it is non tree-shakable. Try out flow instead.",
99
+ name: "lodash-es/chain"
100
+ },
101
+ {
102
+ importNames: [ "chain" ],
103
+ message: "Avoid using chain since it is non tree-shakable. Try out flow instead.",
104
+ name: "lodash-es"
105
+ },
106
+ {
107
+ message: "Please use import foo from 'lodash-es/foo' instead.",
108
+ name: "lodash-es"
109
+ }
110
+ ],
111
+ patterns: [ "@wso2is/**/dist/**", "lodash/**", "lodash/fp/**" ]
112
+ }
113
+ ],
114
+ "semi": 1,
115
+ "jsx-quotes": [ "warn", "prefer-double" ]
116
+ },
117
+ overrides: [
118
+ {
119
+ files: [ "**/*.tsx", "**/*.ts" ],
120
+ parser: "@typescript-eslint/parser",
121
+ extends: [
122
+ "eslint:recommended",
123
+ "plugin:@typescript-eslint/eslint-recommended",
124
+ "plugin:@typescript-eslint/recommended"
125
+ ],
126
+ parserOptions: {
127
+ ecmaVersion: 9,
128
+ sourceType: "module"
129
+ },
130
+ settings: {
131
+ react: {
132
+ version: "detect"
133
+ }
134
+ },
135
+ env: {
136
+ browser: true,
137
+ node: true,
138
+ es6: true
139
+ },
140
+ rules: {
141
+ "eol-last": "error",
142
+ // `no-undef` is discouraged in Typescript projects.
143
+ // https://github.com/typescript-eslint/typescript-eslint/issues/2477#issuecomment-686892459
144
+ "no-undef": 0,
145
+ "@typescript-eslint/no-explicit-any": 0,
146
+ "@typescript-eslint/explicit-function-return-type": 0,
147
+ "@typescript-eslint/no-inferrable-types": "off",
148
+ "no-use-before-define": "off",
149
+ "@typescript-eslint/ban-types": 1,
150
+ "@typescript-eslint/no-empty-function": [ "error", { "allow": [ "constructors" ] } ],
151
+ "@typescript-eslint/no-use-before-define": [
152
+ "warn",
153
+ {
154
+ functions: false,
155
+ classes: false,
156
+ variables: false,
157
+ typedefs: false
158
+ }
159
+ ],
160
+ // In development, error level is set to `warn`. This will be overridden
161
+ // by the production env linting config.
162
+ "no-debugger": 1
163
+ }
164
+ }
165
+ ]
74
166
  };