@tpluscode/eslint-config 2.1.3 → 2.2.0

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 (4) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/js.js +2 -132
  3. package/no-rdf.js +139 -0
  4. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.0
4
+ ### Minor Changes
5
+
6
+ - 302fff0: Added `@tpluscode/eslint-config/no-rdf` export to disable RDF plugin
7
+
3
8
  ## 2.1.3
4
9
  ### Patch Changes
5
10
 
package/js.js CHANGED
@@ -1,142 +1,12 @@
1
- import { createRequire } from 'module'
2
- import js from '@eslint/js'
3
- import globals from 'globals'
4
- import importPlugin from 'eslint-plugin-import'
5
- import mocha from 'eslint-plugin-mocha'
6
- import n from 'eslint-plugin-n'
7
- import promise from 'eslint-plugin-promise'
8
1
  import rdf from 'eslint-plugin-rdf'
9
- import unusedImports from 'eslint-plugin-unused-imports'
10
- import stylistic from '@stylistic/eslint-plugin'
11
-
12
- const require = createRequire(import.meta.url)
13
- const requireExtensions = require('eslint-plugin-require-extensions')
14
-
15
- function rulesFrom(config) {
16
- return config && config.rules ? config.rules : {}
17
- }
2
+ import defaults from './no-rdf.js'
18
3
 
19
4
  export default [
20
- js.configs.recommended,
5
+ ...defaults,
21
6
  rdf.configs.js,
22
7
  {
23
- plugins: { '@stylistic': stylistic },
24
- },
25
- {
26
- files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
27
- ...stylistic.configs['recommended'],
28
- rules: {
29
- '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
30
- },
31
- },
32
- {
33
- files: ['**/*.{js,cjs,mjs}'],
34
- languageOptions: {
35
- ecmaVersion: 'latest',
36
- sourceType: 'module',
37
- globals: {
38
- ...globals.es2022,
39
- ...globals.node,
40
- },
41
- },
42
8
  plugins: {
43
- 'import': importPlugin,
44
- mocha,
45
- n,
46
- promise,
47
9
  rdf,
48
- 'require-extensions': requireExtensions,
49
- 'unused-imports': unusedImports,
50
- },
51
- settings: {
52
- 'import/resolver': {
53
- node: true,
54
- },
55
- },
56
- rules: {
57
- ...rulesFrom(importPlugin.configs.recommended),
58
- ...rulesFrom(n.configs['flat/recommended']),
59
- ...rulesFrom(promise.configs['flat/recommended']),
60
- ...rulesFrom(requireExtensions.configs.recommended),
61
- ...rulesFrom(mocha.configs.recommended),
62
-
63
- 'indent': ['error', 2],
64
- 'no-console': 'error',
65
- 'import/no-unresolved': 'error',
66
- 'import/extensions': 'off',
67
- 'import/order': 'error',
68
- 'space-before-function-paren': [
69
- 'error',
70
- {
71
- named: 'never',
72
- },
73
- ],
74
- 'comma-dangle': [
75
- 'error',
76
- 'always-multiline',
77
- ],
78
- 'import/no-extraneous-dependencies': [
79
- 'error',
80
- {
81
- devDependencies: [
82
- '**/test/**/*.ts',
83
- '**/tests/**/*.ts',
84
- '*.test.ts',
85
- '*.spec.ts',
86
- '*.test.js',
87
- '*.spec.js',
88
- '**/test/**/*.js',
89
- '**/tests/**/*.js',
90
- '*.test.js',
91
- '*.spec.js',
92
- '**/test/**/*.mjs',
93
- '**/tests/**/*.mjs',
94
- '*.test.mjs',
95
- '*.spec.mjs',
96
- ],
97
- optionalDependencies: true,
98
- },
99
- ],
100
- 'no-unused-vars': 'off',
101
- 'unused-imports/no-unused-imports': 'error',
102
- 'unused-imports/no-unused-vars': [
103
- 'warn',
104
- {
105
- vars: 'all',
106
- varsIgnorePattern: '^_',
107
- args: 'after-used',
108
- argsIgnorePattern: '^_',
109
- },
110
- ],
111
- 'mocha/no-sibling-hooks': 'off',
112
- 'mocha/no-setup-in-describe': 'warn',
113
- 'mocha/max-top-level-suites': 'warn',
114
- },
115
- },
116
- {
117
- files: [
118
- '**/*.test.js',
119
- '**/*.spec.js',
120
- '**/*.test.mjs',
121
- '**/*.spec.mjs',
122
- '**/*.test.ts',
123
- '**/*.spec.ts',
124
- ],
125
- languageOptions: {
126
- globals: globals.mocha,
127
- },
128
- rules: {
129
- 'no-unused-expressions': 'off',
130
- 'func-names': 'off',
131
- 'prefer-arrow-callback': 'off',
132
- 'n/no-unpublished-import': 'off',
133
- 'n/no-unpublished-require': 'off',
134
- },
135
- },
136
- {
137
- files: ['eslint.config.*'],
138
- rules: {
139
- 'import/no-extraneous-dependencies': 'off',
140
10
  },
141
11
  },
142
12
  ]
package/no-rdf.js ADDED
@@ -0,0 +1,139 @@
1
+ import { createRequire } from 'module'
2
+ import js from '@eslint/js'
3
+ import globals from 'globals'
4
+ import importPlugin from 'eslint-plugin-import'
5
+ import mocha from 'eslint-plugin-mocha'
6
+ import n from 'eslint-plugin-n'
7
+ import promise from 'eslint-plugin-promise'
8
+ import unusedImports from 'eslint-plugin-unused-imports'
9
+ import stylistic from '@stylistic/eslint-plugin'
10
+
11
+ const require = createRequire(import.meta.url)
12
+ const requireExtensions = require('eslint-plugin-require-extensions')
13
+
14
+ function rulesFrom(config) {
15
+ return config && config.rules ? config.rules : {}
16
+ }
17
+
18
+ export default [
19
+ js.configs.recommended,
20
+ {
21
+ plugins: { '@stylistic': stylistic },
22
+ },
23
+ {
24
+ files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
25
+ ...stylistic.configs['recommended'],
26
+ rules: {
27
+ '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
28
+ },
29
+ },
30
+ {
31
+ files: ['**/*.{js,cjs,mjs}'],
32
+ languageOptions: {
33
+ ecmaVersion: 'latest',
34
+ sourceType: 'module',
35
+ globals: {
36
+ ...globals.es2022,
37
+ ...globals.node,
38
+ },
39
+ },
40
+ plugins: {
41
+ 'import': importPlugin,
42
+ mocha,
43
+ n,
44
+ promise,
45
+ 'require-extensions': requireExtensions,
46
+ 'unused-imports': unusedImports,
47
+ },
48
+ settings: {
49
+ 'import/resolver': {
50
+ node: true,
51
+ },
52
+ },
53
+ rules: {
54
+ ...rulesFrom(importPlugin.configs.recommended),
55
+ ...rulesFrom(n.configs['flat/recommended']),
56
+ ...rulesFrom(promise.configs['flat/recommended']),
57
+ ...rulesFrom(requireExtensions.configs.recommended),
58
+ ...rulesFrom(mocha.configs.recommended),
59
+
60
+ 'indent': ['error', 2],
61
+ 'no-console': 'error',
62
+ 'import/no-unresolved': 'error',
63
+ 'import/extensions': 'off',
64
+ 'import/order': 'error',
65
+ 'space-before-function-paren': [
66
+ 'error',
67
+ {
68
+ named: 'never',
69
+ },
70
+ ],
71
+ 'comma-dangle': [
72
+ 'error',
73
+ 'always-multiline',
74
+ ],
75
+ 'import/no-extraneous-dependencies': [
76
+ 'error',
77
+ {
78
+ devDependencies: [
79
+ '**/test/**/*.ts',
80
+ '**/tests/**/*.ts',
81
+ '*.test.ts',
82
+ '*.spec.ts',
83
+ '*.test.js',
84
+ '*.spec.js',
85
+ '**/test/**/*.js',
86
+ '**/tests/**/*.js',
87
+ '*.test.js',
88
+ '*.spec.js',
89
+ '**/test/**/*.mjs',
90
+ '**/tests/**/*.mjs',
91
+ '*.test.mjs',
92
+ '*.spec.mjs',
93
+ ],
94
+ optionalDependencies: true,
95
+ },
96
+ ],
97
+ 'no-unused-vars': 'off',
98
+ 'unused-imports/no-unused-imports': 'error',
99
+ 'unused-imports/no-unused-vars': [
100
+ 'warn',
101
+ {
102
+ vars: 'all',
103
+ varsIgnorePattern: '^_',
104
+ args: 'after-used',
105
+ argsIgnorePattern: '^_',
106
+ },
107
+ ],
108
+ 'mocha/no-sibling-hooks': 'off',
109
+ 'mocha/no-setup-in-describe': 'warn',
110
+ 'mocha/max-top-level-suites': 'warn',
111
+ },
112
+ },
113
+ {
114
+ files: [
115
+ '**/*.test.js',
116
+ '**/*.spec.js',
117
+ '**/*.test.mjs',
118
+ '**/*.spec.mjs',
119
+ '**/*.test.ts',
120
+ '**/*.spec.ts',
121
+ ],
122
+ languageOptions: {
123
+ globals: globals.mocha,
124
+ },
125
+ rules: {
126
+ 'no-unused-expressions': 'off',
127
+ 'func-names': 'off',
128
+ 'prefer-arrow-callback': 'off',
129
+ 'n/no-unpublished-import': 'off',
130
+ 'n/no-unpublished-require': 'off',
131
+ },
132
+ },
133
+ {
134
+ files: ['eslint.config.*'],
135
+ rules: {
136
+ 'import/no-extraneous-dependencies': 'off',
137
+ },
138
+ },
139
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpluscode/eslint-config",
3
- "version": "2.1.3",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "exports": {
12
12
  "./js": "./js.js",
13
+ "./no-rdf": "./no-rdf.js",
13
14
  ".": "./index.js"
14
15
  },
15
16
  "engines": {