@lvce-editor/eslint-plugin-eslint-config 18.7.1 → 18.9.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 (2) hide show
  1. package/dist/index.js +42 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -50,7 +50,7 @@ const isDefineConfigCall = (node, bindings) => {
50
50
  }
51
51
  return callee.type === 'MemberExpression' && callee.object.type === 'Identifier' && bindings.namespaces.has(callee.object.name) && isDefineConfigProperty(callee);
52
52
  };
53
- const meta$1 = {
53
+ const meta$2 = {
54
54
  docs: {
55
55
  description: 'Enforce using defineConfig from eslint/config for ESLint flat configurations'
56
56
  },
@@ -59,7 +59,7 @@ const meta$1 = {
59
59
  },
60
60
  type: 'suggestion'
61
61
  };
62
- const create$1 = context => {
62
+ const create$2 = context => {
63
63
  return {
64
64
  'Program:exit'(program) {
65
65
  const bindings = getDefineConfigBindings(program);
@@ -77,15 +77,15 @@ const create$1 = context => {
77
77
 
78
78
  const defineConfig = {
79
79
  __proto__: null,
80
- create: create$1,
81
- meta: meta$1
80
+ create: create$2,
81
+ meta: meta$2
82
82
  };
83
83
 
84
84
  const githubActionsPlugin = '@lvce-editor/eslint-plugin-github-actions';
85
85
  const isGithubActionsPlugin = source => {
86
86
  return typeof source === 'string' && (source === githubActionsPlugin || source.startsWith(`${githubActionsPlugin}/`));
87
87
  };
88
- const meta = {
88
+ const meta$1 = {
89
89
  docs: {
90
90
  description: 'Prefer the shared recommendedActions configuration over importing the GitHub Actions plugin directly'
91
91
  },
@@ -94,7 +94,7 @@ const meta = {
94
94
  },
95
95
  type: 'suggestion'
96
96
  };
97
- const create = context => {
97
+ const create$1 = context => {
98
98
  return {
99
99
  ImportDeclaration(node) {
100
100
  if (isGithubActionsPlugin(node.source.value)) {
@@ -108,6 +108,38 @@ const create = context => {
108
108
  };
109
109
 
110
110
  const preferRecommendedActions = {
111
+ __proto__: null,
112
+ create: create$1,
113
+ meta: meta$1
114
+ };
115
+
116
+ const regexPlugin = '@lvce-editor/eslint-plugin-regex';
117
+ const isRegexPlugin = source => {
118
+ return typeof source === 'string' && (source === regexPlugin || source.startsWith(`${regexPlugin}/`));
119
+ };
120
+ const meta = {
121
+ docs: {
122
+ description: 'Prefer the shared recommendedRegex configuration over importing the regex plugin directly'
123
+ },
124
+ messages: {
125
+ preferRecommendedRegex: 'Use `config.recommendedRegex` from `@lvce-editor/eslint-config` instead of importing `@lvce-editor/eslint-plugin-regex` directly.'
126
+ },
127
+ type: 'suggestion'
128
+ };
129
+ const create = context => {
130
+ return {
131
+ ImportDeclaration(node) {
132
+ if (isRegexPlugin(node.source.value)) {
133
+ context.report({
134
+ messageId: 'preferRecommendedRegex',
135
+ node
136
+ });
137
+ }
138
+ }
139
+ };
140
+ };
141
+
142
+ const preferRecommendedRegex = {
111
143
  __proto__: null,
112
144
  create,
113
145
  meta
@@ -121,7 +153,8 @@ const plugin = {
121
153
  },
122
154
  rules: {
123
155
  'define-config': defineConfig,
124
- 'prefer-recommended-actions': preferRecommendedActions
156
+ 'prefer-recommended-actions': preferRecommendedActions,
157
+ 'prefer-recommended-regex': preferRecommendedRegex
125
158
  }
126
159
  };
127
160
  const recommended = [{
@@ -131,7 +164,8 @@ const recommended = [{
131
164
  },
132
165
  rules: {
133
166
  'eslint-config/define-config': 'error',
134
- 'eslint-config/prefer-recommended-actions': 'error'
167
+ 'eslint-config/prefer-recommended-actions': 'error',
168
+ 'eslint-config/prefer-recommended-regex': 'error'
135
169
  }
136
170
  }];
137
171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/eslint-plugin-eslint-config",
3
- "version": "18.7.1",
3
+ "version": "18.9.0",
4
4
  "main": "dist/index.js",
5
5
  "repository": {
6
6
  "type": "git",