@dashadmin/dash-eslint 1.3.16

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.
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ ...require("@dashadmin/dash-prettier"),
3
+ }
package/DEVNOTES.md ADDED
@@ -0,0 +1,84 @@
1
+ # DEVNOTES:
2
+
3
+ - [BUG] 'airbnb-typescript'
4
+ - - Error: Error while loading rule '@typescript-eslint/dot-notation': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
5
+
6
+ # OLD SETTINGS FOR REFERENCE
7
+
8
+ module.exports {
9
+
10
+ "extends":[
11
+ "turbo",
12
+ "plugin:react/recommended",
13
+ "plugin:react/jsx-runtime",
14
+ "prettier",
15
+ "./jsdoc.js",
16
+ "./typescript.cjs"
17
+ ],
18
+ "rules":{
19
+ "react/jsx-key":"off",
20
+ "@next/next/no-html-link-for-pages":"off" // this settings produce also the '@typescript-eslint/dot-notation' Error.
21
+ },
22
+ "parser":"@typescript-eslint/parser",
23
+ "parserOptions":{
24
+ "ecmaVersion":2020,
25
+ "sourceType":"module",
26
+ "ecmaFeatures":{
27
+ "jsx":true
28
+ }
29
+ },
30
+ "settings":{
31
+ "react":{
32
+ "version":"detect"
33
+ }
34
+ }
35
+ }
36
+
37
+ "overrides":[
38
+ {
39
+ "files":[
40
+ "_.tsx"
41
+ ],
42
+ "rules":{
43
+ "jsdoc/require-jsdoc":"off",
44
+ "jsdoc/require-param":"off",
45
+ "@typescript-eslint/naming-convention":[
46
+ "off",
47
+ {
48
+ "selector":[
49
+ "enumMember",
50
+ "interface"
51
+ ],
52
+ "format":[
53
+ "PascalCase"
54
+ ]
55
+ },
56
+ {
57
+ "selector":[
58
+ "variable",
59
+ "function",
60
+ "classMethod"
61
+ ],
62
+ "leadingUnderscore":"allow",
63
+ "trailingUnderscore":"allow",
64
+ "format":[
65
+ "camelCase"
66
+ ]
67
+ }
68
+ ]
69
+ }
70
+ }
71
+ ],
72
+ "rules":{
73
+ "@next/next/no-img-element":"off",
74
+ "no-unused-vars":[
75
+ "error",
76
+ {
77
+ "argsIgnorePattern":"^_"
78
+ }
79
+ ],
80
+ "eqeqeq":[
81
+ "error",
82
+ "always"
83
+ ]
84
+ }
package/index.js ADDED
@@ -0,0 +1,134 @@
1
+ // eslint-disable-next-line no-undef
2
+ module.exports = {
3
+ globals: {
4
+ React: true,
5
+ google: true,
6
+ context: true,
7
+ expect: true,
8
+ jsdom: true,
9
+ JSX: true,
10
+ },
11
+ extends: [
12
+ './jsdoc.js',
13
+ './typescript.cjs',
14
+ 'plugin:react/recommended',
15
+ 'plugin:react/jsx-runtime',
16
+ 'prettier',
17
+ 'plugin:jsx-a11y/recommended',
18
+ 'airbnb-typescript',
19
+ 'eslint:recommended',
20
+ //'turbo',
21
+ ],
22
+ plugins: [
23
+ 'react',
24
+ 'html',
25
+ 'json',
26
+ 'prettier',
27
+ 'import',
28
+ 'jsx-a11y',
29
+ '@typescript-eslint',
30
+ ],
31
+
32
+ parserOptions: {
33
+ parser: '@typescript-eslint/parser',
34
+ ecmaVersion: 2020,
35
+ sourceType: 'module',
36
+ ecmaFeatures: {
37
+ jsx: true,
38
+ },
39
+ },
40
+ overrides: [
41
+ {
42
+ files: ['*.tsx'],
43
+ rules: {
44
+ "react/react-in-jsx-scope": "off",
45
+ "jsdoc/no-types": "off",
46
+ "react/jsx-uses-react": 'off',
47
+ "react/jsx-no-useless-fragment": ["warn", { "allowExpressions": true }],
48
+ 'jsdoc/require-jsdoc': 'off',
49
+ 'jsdoc/require-param': 'off',
50
+ 'no-undef': 'off',
51
+ '@typescript-eslint/naming-convention': [
52
+ 'off',
53
+ {
54
+ selector: ['enumMember', 'interface'],
55
+ format: ['PascalCase'],
56
+ },
57
+ {
58
+ selector: ['variable', 'function', 'classMethod'],
59
+ leadingUnderscore: 'allow',
60
+ trailingUnderscore: 'allow',
61
+ format: ['camelCase'],
62
+ },
63
+ ],
64
+ },
65
+ },
66
+ ],
67
+ rules: {
68
+ 'react/prop-types': 'off',
69
+ 'react/display-name': 'off',
70
+
71
+ 'import/no-extraneous-dependencies': [
72
+ 'error',
73
+ {
74
+ //devDependencies: ['**/*.stories.*', '**/.storybook/**/*.*'],
75
+ devDependencies: true,
76
+ peerDependencies: true,
77
+ optionalDependencies: true,
78
+ bundledDependencies: true,
79
+ },
80
+ ],
81
+ // https://stackoverflow.com/questions/56337176/prettier-and-eslint-indents-not-working-together
82
+ '@typescript-eslint/indent': ['error', 'tab'],
83
+ quotes: [2, 'single', { avoidEscape: true, allowTemplateLiterals: true }],
84
+ '@next/next/no-img-element': 'off',
85
+
86
+ /*'no-unused-vars': [
87
+ 'error',
88
+ {
89
+ argsIgnorePattern: '^_',
90
+ varsIgnorePattern: 'React',
91
+ //"varsIgnorePattern": "^(?:React|child)$"
92
+ },
93
+ ],*/
94
+
95
+ '@typescript-eslint/no-explicit-any': 'off',
96
+ '@typescript-eslint/no-unused-vars': [
97
+ 'error',
98
+ {
99
+ ignoreRestSiblings: true,
100
+ argsIgnorePattern: '^_',
101
+ varsIgnorePattern: 'React',
102
+ },
103
+ ],
104
+ 'no-explicit-any': 'off',
105
+ 'no-unused-vars': [
106
+ 'error',
107
+ {
108
+ ignoreRestSiblings: true,
109
+ argsIgnorePattern: '^_',
110
+ varsIgnorePattern: 'React',
111
+ },
112
+ ],
113
+
114
+ //semi: ['error', 'always', { 'omitLastInOneLineClassBody': true }],
115
+ eqeqeq: ['error', 'always'],
116
+ 'no-console': 'off',
117
+ 'import/no-unresolved': [2, { commonjs: true, amd: true }],
118
+ 'import/named': 0,
119
+ 'import/namespace': 2,
120
+ 'import/default': 2,
121
+ 'import/export': 2,
122
+ 'import/extensions': [
123
+ 'error',
124
+ 'ignorePackages',
125
+ {
126
+ js: 'never',
127
+ jsx: 'never',
128
+ ts: 'never',
129
+ tsx: 'never',
130
+ '': 'never',
131
+ },
132
+ ],
133
+ },
134
+ };
package/jsdoc.js ADDED
@@ -0,0 +1,75 @@
1
+ // eslint-disable-next-line no-undef
2
+ module.exports = {
3
+ extends: ['plugin:jsdoc/recommended'],
4
+ plugins: ['jsdoc'],
5
+ rules: {
6
+ 'brace-style': ['error', '1tbs'],
7
+ eqeqeq: 'error',
8
+ 'keyword-spacing': [2, { before: true, after: true }],
9
+ 'lines-between-class-members': 'error',
10
+ 'max-len': [
11
+ 'error',
12
+ {
13
+ code: 140,
14
+ tabWidth: 2,
15
+ ignorePattern: '^\\s*import ',
16
+ ignoreUrls: true,
17
+ ignoreRegExpLiterals: true,
18
+ },
19
+ ],
20
+ 'no-console': 'error',
21
+ semi: 'error',
22
+
23
+ 'jsdoc/check-alignment': 'error',
24
+ 'jsdoc/check-indentation': 'error',
25
+ 'jsdoc/check-param-names': 'error',
26
+ 'jsdoc/check-property-names': 'error',
27
+ 'jsdoc/check-syntax': 'error',
28
+ 'jsdoc/check-tag-names': 'error',
29
+ 'jsdoc/check-types': 'error',
30
+ 'jsdoc/check-values': 'error',
31
+ 'jsdoc/empty-tags': 'error',
32
+ 'jsdoc/implements-on-classes': 'error',
33
+ 'jsdoc/match-description': 'error',
34
+ 'jsdoc/newline-after-description': 'error',
35
+ 'jsdoc/no-bad-blocks': 'warn',
36
+ 'jsdoc/no-types': 'error',
37
+ 'jsdoc/require-description': 'error',
38
+ //'jsdoc/require-description-complete-sentence': 'off',
39
+ 'jsdoc/require-jsdoc': [
40
+ 'error',
41
+ {
42
+ publicOnly: false,
43
+ require: {
44
+ FunctionDeclaration: true,
45
+ MethodDefinition: true,
46
+ ClassDeclaration: true,
47
+ ArrowFunctionExpression: true,
48
+ FunctionExpression: true,
49
+ },
50
+ contexts: [
51
+ {
52
+ context: 'ClassProperty',
53
+ inlineCommentBlock: true,
54
+ },
55
+ {
56
+ context: 'TSPropertySignature',
57
+ inlineCommentBlock: true,
58
+ },
59
+ ],
60
+ exemptEmptyFunctions: false,
61
+ checkConstructors: false,
62
+ },
63
+ ],
64
+ 'jsdoc/require-param': 'error',
65
+ 'jsdoc/require-param-description': 'error',
66
+ 'jsdoc/require-param-name': 'error',
67
+ 'jsdoc/require-property': 'error',
68
+ 'jsdoc/require-property-description': 'error',
69
+ 'jsdoc/require-property-name': 'error',
70
+ 'jsdoc/require-returns': 'error',
71
+ 'jsdoc/require-returns-check': 'error',
72
+ 'jsdoc/require-returns-description': 'error',
73
+ 'jsdoc/require-yields-check': 'error',
74
+ },
75
+ };
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@dashadmin/dash-eslint",
3
+ "version": "1.3.16",
4
+ "private": false,
5
+ "main": "index.js",
6
+ "license": "MIT",
7
+ "dependencies": {},
8
+ "devDependencies": {
9
+ "@typescript-eslint/eslint-plugin": "latest",
10
+ "@typescript-eslint/parser": "latest",
11
+ "eslint-config-prettier": "latest",
12
+ "eslint-plugin-react": "latest",
13
+ "eslint-config-airbnb": "latest",
14
+ "eslint-config-airbnb-typescript": "latest",
15
+ "eslint-config-turbo": "latest",
16
+ "turbo": "latest",
17
+ "@dashadmin/dash-prettier": "workspace:*"
18
+ },
19
+ "publishConfig": {
20
+ "name": "@dashadmin/dash-eslint",
21
+ "access": "public"
22
+ }
23
+ }
package/typescript.cjs ADDED
@@ -0,0 +1,60 @@
1
+ // eslint-disable-next-line no-undef
2
+ module.exports = {
3
+ extends: ['plugin:@typescript-eslint/recommended'],
4
+ rules: {
5
+
6
+ '@typescript-eslint/no-explicit-any': 'off',
7
+ '@typescript-eslint/no-unused-vars': ['error', { 'ignoreRestSiblings': true }],
8
+ 'no-shadow': 'off',
9
+ 'jsdoc/require-param-type': 'off',
10
+ 'jsdoc/require-property-type': 'off',
11
+ 'jsdoc/require-returns-type': 'off',
12
+ '@typescript-eslint/consistent-type-definitions': 'error',
13
+ //'@typescript-eslint/no-explicit-any': 'error',
14
+ '@typescript-eslint/no-non-null-assertion': 'error',
15
+ '@typescript-eslint/no-shadow': 'error',
16
+ //'@typescript-eslint/no-unused-vars': 'error',
17
+ '@typescript-eslint/naming-convention': [
18
+ 'error',
19
+ {
20
+ selector: 'enumMember',
21
+ format: ['PascalCase'],
22
+ },
23
+ {
24
+ selector: ['variable', 'function', 'classMethod'],
25
+ leadingUnderscore: 'allow',
26
+ trailingUnderscore: 'allow',
27
+ format: ['camelCase'],
28
+ },
29
+ {
30
+ selector: ['interface'],
31
+ leadingUnderscore: 'allow',
32
+ trailingUnderscore: 'allow',
33
+ format: ['PascalCase'],
34
+ },
35
+ ],
36
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
37
+ '@typescript-eslint/no-namespace': 'off',
38
+ '@typescript-eslint/ban-ts-comment': [
39
+ 'error',
40
+ { 'ts-ignore': 'allow-with-description' },
41
+ ],
42
+ '@typescript-eslint/ban-ts-ignore': 'off',
43
+ '@typescript-eslint/no-throw-literal' : 'off',
44
+ '@typescript-eslint/ban-types': ['error',
45
+ {
46
+ 'types': {
47
+ 'String': false,
48
+ 'Boolean': false,
49
+ 'Number': false,
50
+ 'Symbol': false,
51
+ '{}': false,
52
+ 'Object': false,
53
+ 'object': false,
54
+ 'Function': false,
55
+ },
56
+ 'extendDefaults': true,
57
+ },
58
+ ],
59
+ },
60
+ };