@tpluscode/eslint-config 2.1.2 → 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 +10 -0
  2. package/js.js +2 -129
  3. package/no-rdf.js +139 -0
  4. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
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
+
8
+ ## 2.1.3
9
+ ### Patch Changes
10
+
11
+ - 573efa1: Stylistic: Allow double quotes containing unescaped single quotes
12
+
3
13
  ## 2.1.2
4
14
  ### Patch Changes
5
15
 
package/js.js CHANGED
@@ -1,139 +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
- },
29
- {
30
- files: ['**/*.{js,cjs,mjs}'],
31
- languageOptions: {
32
- ecmaVersion: 'latest',
33
- sourceType: 'module',
34
- globals: {
35
- ...globals.es2022,
36
- ...globals.node,
37
- },
38
- },
39
8
  plugins: {
40
- 'import': importPlugin,
41
- mocha,
42
- n,
43
- promise,
44
9
  rdf,
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
10
  },
138
11
  },
139
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.2",
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": {