eslint-config-nodebb 1.0.0 → 1.0.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.
Files changed (3) hide show
  1. package/index.cjs +93 -1
  2. package/package.json +2 -2
  3. package/lib.js +0 -93
package/index.cjs CHANGED
@@ -1 +1,93 @@
1
- module.exports = require('./lib');
1
+ export default [
2
+ {
3
+ files: ['**/*.js'],
4
+ languageOptions: {
5
+ ecmaVersion: 2020,
6
+ sourceType: 'script', // equivalent to your v8 "parserOptions.sourceType"
7
+ globals: {
8
+ // Node.js globals are implied, no need to redefine unless custom ones are used
9
+ }
10
+ },
11
+ linterOptions: {
12
+ reportUnusedDisableDirectives: true
13
+ },
14
+ rules: {
15
+ // === Project Style Rules ===
16
+ 'import/no-unresolved': 'error',
17
+ 'quotes': ['error', 'single', {
18
+ avoidEscape: true,
19
+ allowTemplateLiterals: true
20
+ }],
21
+ 'no-else-return': ['error', { allowElseIf: true }],
22
+ 'operator-linebreak': ['error', 'after'],
23
+ 'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
24
+ 'handle-callback-err': ['error', '^(e$|(e|(.*(_e|E)))rr)'],
25
+ 'comma-dangle': ['error', {
26
+ arrays: 'always-multiline',
27
+ objects: 'always-multiline',
28
+ imports: 'always-multiline',
29
+ exports: 'always-multiline',
30
+ functions: 'only-multiline'
31
+ }],
32
+ 'no-return-await': 'off',
33
+ 'no-constant-condition': ['error', { checkLoops: false }],
34
+ 'no-empty': ['error', { allowEmptyCatch: true }],
35
+ 'no-mixed-operators': ['error', { allowSamePrecedence: true }],
36
+ 'strict': ['error', 'global'],
37
+ 'indent': ['error', 'tab', { SwitchCase: 1 }],
38
+ 'no-tabs': ['error', { allowIndentationTabs: true }],
39
+ 'no-eq-null': 'off',
40
+ 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
41
+ 'no-use-before-define': ['error', 'nofunc'],
42
+ 'object-curly-newline': ['error', { consistent: true, multiline: true }],
43
+ 'function-paren-newline': ['error', 'consistent'],
44
+ 'prefer-const': ['error', { destructuring: 'all' }],
45
+ 'prefer-destructuring': ['error', {
46
+ VariableDeclarator: { array: false, object: true },
47
+ AssignmentExpression: { array: false, object: false }
48
+ }],
49
+ 'no-restricted-syntax': [
50
+ 'error',
51
+ {
52
+ selector: 'ForInStatement',
53
+ message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.'
54
+ },
55
+ {
56
+ selector: 'LabeledStatement',
57
+ message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.'
58
+ },
59
+ {
60
+ selector: 'WithStatement',
61
+ message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.'
62
+ }
63
+ ],
64
+ 'max-len': ['error', {
65
+ code: 120,
66
+ tabWidth: 2,
67
+ ignoreUrls: true,
68
+ ignoreStrings: true,
69
+ ignoreTemplateLiterals: true,
70
+ ignoreRegExpLiterals: true
71
+ }],
72
+
73
+ // === Disable Rules ===
74
+ 'camelcase': 'off',
75
+ 'no-underscore-dangle': 'off',
76
+ 'func-names': 'off',
77
+ 'no-console': 'off',
78
+ 'no-new': 'off',
79
+ 'new-cap': 'off',
80
+ 'no-shadow': 'off',
81
+ 'no-multiple-empty-lines': 'off',
82
+ 'object-shorthand': 'off',
83
+ 'consistent-return': 'off',
84
+ 'no-restricted-globals': 'off',
85
+ 'no-prototype-builtins': 'off',
86
+ 'import/no-extraneous-dependencies': 'off',
87
+ 'import/no-dynamic-require': 'off',
88
+ 'global-require': 'off',
89
+ 'no-param-reassign': 'off',
90
+ 'default-case': 'off'
91
+ }
92
+ }
93
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-nodebb",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  "keywords": [],
10
10
  "author": "",
11
11
  "exports": {
12
- ".": "./index.js",
12
+ ".": "./index.cjs",
13
13
  "./public": "./public.js"
14
14
  },
15
15
  "peerDependencies": {
package/lib.js DELETED
@@ -1,93 +0,0 @@
1
- export default [
2
- {
3
- files: ['**/*.js'],
4
- languageOptions: {
5
- ecmaVersion: 2020,
6
- sourceType: 'script', // equivalent to your v8 "parserOptions.sourceType"
7
- globals: {
8
- // Node.js globals are implied, no need to redefine unless custom ones are used
9
- }
10
- },
11
- linterOptions: {
12
- reportUnusedDisableDirectives: true
13
- },
14
- rules: {
15
- // === Project Style Rules ===
16
- 'import/no-unresolved': 'error',
17
- 'quotes': ['error', 'single', {
18
- avoidEscape: true,
19
- allowTemplateLiterals: true
20
- }],
21
- 'no-else-return': ['error', { allowElseIf: true }],
22
- 'operator-linebreak': ['error', 'after'],
23
- 'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
24
- 'handle-callback-err': ['error', '^(e$|(e|(.*(_e|E)))rr)'],
25
- 'comma-dangle': ['error', {
26
- arrays: 'always-multiline',
27
- objects: 'always-multiline',
28
- imports: 'always-multiline',
29
- exports: 'always-multiline',
30
- functions: 'only-multiline'
31
- }],
32
- 'no-return-await': 'off',
33
- 'no-constant-condition': ['error', { checkLoops: false }],
34
- 'no-empty': ['error', { allowEmptyCatch: true }],
35
- 'no-mixed-operators': ['error', { allowSamePrecedence: true }],
36
- 'strict': ['error', 'global'],
37
- 'indent': ['error', 'tab', { SwitchCase: 1 }],
38
- 'no-tabs': ['error', { allowIndentationTabs: true }],
39
- 'no-eq-null': 'off',
40
- 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
41
- 'no-use-before-define': ['error', 'nofunc'],
42
- 'object-curly-newline': ['error', { consistent: true, multiline: true }],
43
- 'function-paren-newline': ['error', 'consistent'],
44
- 'prefer-const': ['error', { destructuring: 'all' }],
45
- 'prefer-destructuring': ['error', {
46
- VariableDeclarator: { array: false, object: true },
47
- AssignmentExpression: { array: false, object: false }
48
- }],
49
- 'no-restricted-syntax': [
50
- 'error',
51
- {
52
- selector: 'ForInStatement',
53
- message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.'
54
- },
55
- {
56
- selector: 'LabeledStatement',
57
- message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.'
58
- },
59
- {
60
- selector: 'WithStatement',
61
- message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.'
62
- }
63
- ],
64
- 'max-len': ['error', {
65
- code: 120,
66
- tabWidth: 2,
67
- ignoreUrls: true,
68
- ignoreStrings: true,
69
- ignoreTemplateLiterals: true,
70
- ignoreRegExpLiterals: true
71
- }],
72
-
73
- // === Disable Rules ===
74
- 'camelcase': 'off',
75
- 'no-underscore-dangle': 'off',
76
- 'func-names': 'off',
77
- 'no-console': 'off',
78
- 'no-new': 'off',
79
- 'new-cap': 'off',
80
- 'no-shadow': 'off',
81
- 'no-multiple-empty-lines': 'off',
82
- 'object-shorthand': 'off',
83
- 'consistent-return': 'off',
84
- 'no-restricted-globals': 'off',
85
- 'no-prototype-builtins': 'off',
86
- 'import/no-extraneous-dependencies': 'off',
87
- 'import/no-dynamic-require': 'off',
88
- 'global-require': 'off',
89
- 'no-param-reassign': 'off',
90
- 'default-case': 'off'
91
- }
92
- }
93
- ];