@rotki/eslint-plugin 0.0.2 → 0.1.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.
package/dist/index.mjs ADDED
@@ -0,0 +1,390 @@
1
+ import { extname } from 'node:path';
2
+ import * as compat from 'eslint-compat-utils';
3
+ import createDebug from 'debug';
4
+ import { pascalCase, snakeCase } from 'scule';
5
+
6
+ const name = "@rotki/eslint-plugin";
7
+ const version = "0.1.0";
8
+ const packageManager = "pnpm@8.14.1";
9
+ const type = "module";
10
+ const license = "AGPL-3.0";
11
+ const bugs = {
12
+ url: "https://github.com/rotki/eslint-plugin/issues"
13
+ };
14
+ const repository = {
15
+ type: "git",
16
+ url: "https://github.com/rotki/eslint-plugin.git"
17
+ };
18
+ const author = "Rotki Solutions GmbH <info@rotki.com>";
19
+ const files = [
20
+ "dist"
21
+ ];
22
+ const main = "./dist/index.mjs";
23
+ const module = "./dist/index.mjs";
24
+ const types = "./dist/index.d.ts";
25
+ const exports = {
26
+ ".": {
27
+ types: "./dist/index.d.ts",
28
+ require: "./dist/index.cjs",
29
+ "import": "./dist/index.mjs"
30
+ }
31
+ };
32
+ const sideEffects = false;
33
+ const scripts = {
34
+ clean: "rimraf .nyc_output coverage dist docs/.vitepress/dist",
35
+ coverage: "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
36
+ generate: "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-rule-docs.ts",
37
+ lint: "eslint .",
38
+ "lint:fix": "eslint . --fix",
39
+ build: "unbuild",
40
+ dev: "unbuild --stub",
41
+ prepublishOnly: "pnpm run build",
42
+ test: "vitest",
43
+ "new": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/new-rule.ts",
44
+ docs: "vitepress dev docs",
45
+ "docs:build": "pnpm run generate && vitepress build docs",
46
+ prepare: "husky install",
47
+ typecheck: "tsc --noEmit",
48
+ release: "bumpp -r --no-push"
49
+ };
50
+ const peerDependencies = {
51
+ eslint: "^8.0.0 || ^9.0.0"
52
+ };
53
+ const dependencies = {
54
+ "@typescript-eslint/utils": "6.19.0",
55
+ debug: "4.3.4",
56
+ "eslint-compat-utils": "0.4.1",
57
+ "jsonc-eslint-parser": "2.4.0",
58
+ scule: "1.2.0",
59
+ "vue-eslint-parser": "9.4.1",
60
+ "yaml-eslint-parser": "1.2.2"
61
+ };
62
+ const devDependencies = {
63
+ "@commitlint/cli": "18.5.0",
64
+ "@commitlint/config-conventional": "18.5.0",
65
+ "@rotki/eslint-config": "2.3.0",
66
+ "@types/debug": "4.1.12",
67
+ "@types/eslint": "8.56.2",
68
+ "@types/node": "20",
69
+ "@typescript-eslint/eslint-plugin": "6.19.0",
70
+ "@typescript-eslint/parser": "6.19.0",
71
+ "@typescript-eslint/rule-tester": "6.19.0",
72
+ bumpp: "9.3.0",
73
+ eslint: "8.56.0",
74
+ husky: "8.0.3",
75
+ "lint-staged": "15.2.0",
76
+ rimraf: "5.0.5",
77
+ "ts-node": "10.9.2",
78
+ typescript: "5.3.3",
79
+ unbuild: "2.0.0",
80
+ vitepress: "1.0.0-rc.40",
81
+ vitest: "1.2.1"
82
+ };
83
+ const engines = {
84
+ node: ">=18.0.0",
85
+ pnpm: ">=8 <9"
86
+ };
87
+ const pkg = {
88
+ name: name,
89
+ version: version,
90
+ packageManager: packageManager,
91
+ type: type,
92
+ license: license,
93
+ bugs: bugs,
94
+ repository: repository,
95
+ author: author,
96
+ files: files,
97
+ main: main,
98
+ module: module,
99
+ types: types,
100
+ exports: exports,
101
+ sideEffects: sideEffects,
102
+ scripts: scripts,
103
+ peerDependencies: peerDependencies,
104
+ dependencies: dependencies,
105
+ devDependencies: devDependencies,
106
+ engines: engines,
107
+ "lint-staged": {
108
+ "*.{js,cjs,ts,vue,yml,json,md}": "eslint"
109
+ }
110
+ };
111
+
112
+ function getFilename(context) {
113
+ return compat.getFilename(context);
114
+ }
115
+ function getSourceCode(context) {
116
+ return compat.getSourceCode(context);
117
+ }
118
+
119
+ const blobUrl = "https://rotki.github.io/eslint-plugin/rules/";
120
+ function RuleCreator(urlCreator) {
121
+ return function createNamedRule({
122
+ meta,
123
+ name,
124
+ ...rule
125
+ }) {
126
+ return createRule({
127
+ meta: {
128
+ ...meta,
129
+ docs: {
130
+ ...meta.docs,
131
+ url: urlCreator(name)
132
+ }
133
+ },
134
+ ...rule
135
+ });
136
+ };
137
+ }
138
+ function createRule({
139
+ create,
140
+ defaultOptions,
141
+ meta
142
+ }) {
143
+ return {
144
+ create: (context) => {
145
+ const optionsWithDefault = context.options.map((options, index) => ({
146
+ ...defaultOptions[index] || {},
147
+ ...options || {}
148
+ }));
149
+ return create(context, optionsWithDefault);
150
+ },
151
+ defaultOptions,
152
+ meta
153
+ };
154
+ }
155
+ const createEslintRule = RuleCreator(
156
+ (ruleName) => `${blobUrl}${ruleName}`
157
+ );
158
+
159
+ function defineTemplateBodyVisitor(context, templateBodyVisitor, scriptVisitor, options) {
160
+ const sourceCode = getSourceCode(context);
161
+ const parserServices = sourceCode.parserServices;
162
+ if (!("defineTemplateBodyVisitor" in parserServices) || parserServices.defineTemplateBodyVisitor == null) {
163
+ const filename = getFilename(context);
164
+ if (extname(filename) === ".vue") {
165
+ context.report({
166
+ loc: { column: 0, line: 1 },
167
+ message: "Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error"
168
+ });
169
+ }
170
+ return {};
171
+ }
172
+ return parserServices.defineTemplateBodyVisitor(
173
+ templateBodyVisitor,
174
+ scriptVisitor,
175
+ options
176
+ );
177
+ }
178
+
179
+ const RULE_NAME$1 = "no-deprecated-classes";
180
+ const replacements$1 = [
181
+ ["d-block", "block"],
182
+ ["d-flex", "flex"],
183
+ ["flex-column", "flex-col"],
184
+ ["flex-grow-1", "grow"],
185
+ ["flex-grow-0", "grow-0"],
186
+ ["flex-shrink-1", "shrink"],
187
+ ["flex-shrink-0", "shrink-0"],
188
+ [
189
+ /^align-(start|end|center|baseline|stretch)$/,
190
+ ([align]) => `items-${align}`
191
+ ],
192
+ [/^justify-space-(between|around)$/, ([justify]) => `justify-${justify}`],
193
+ [
194
+ /^align-self-(start|end|center|baseline|auto|strech)$/,
195
+ ([align]) => `self-${align}`
196
+ ],
197
+ [
198
+ /^font-weight-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,
199
+ ([weight]) => `font-${weight}`
200
+ ],
201
+ [/^text-(capitalize|uppercase|lowercase)$/, ([casing]) => casing]
202
+ ];
203
+ function isString(replacement) {
204
+ return typeof replacement[0] === "string";
205
+ }
206
+ function isRegex(replacement) {
207
+ return replacement[0] instanceof RegExp;
208
+ }
209
+ const noDeprecatedClasses = createEslintRule({
210
+ create(context) {
211
+ return defineTemplateBodyVisitor(context, {
212
+ 'VAttribute[key.name="class"]': function(node) {
213
+ if (!node.value || !node.value.value)
214
+ return;
215
+ const classes = node.value.value.split(/\s+/).filter((s) => !!s);
216
+ const source = getSourceCode(context);
217
+ const replaced = [];
218
+ classes.forEach((className) => {
219
+ for (const replacement of replacements$1) {
220
+ if (isString(replacement) && replacement[0] === className)
221
+ replaced.push([className, replacement[1]]);
222
+ if (isRegex(replacement)) {
223
+ const matches = (replacement[0].exec(className) || []).slice(1);
224
+ const replace = replacement[1];
225
+ if (matches.length > 0 && typeof replace === "function")
226
+ return replaced.push([className, replace(matches)]);
227
+ }
228
+ }
229
+ });
230
+ replaced.forEach((replacement) => {
231
+ if (!node.value)
232
+ return;
233
+ const idx = node.value.value.indexOf(replacement[0]) + 1;
234
+ const range = [
235
+ node.value.range[0] + idx,
236
+ node.value.range[0] + idx + replacement[0].length
237
+ ];
238
+ const loc = {
239
+ end: source.getLocFromIndex(range[1]),
240
+ start: source.getLocFromIndex(range[0])
241
+ };
242
+ context.report({
243
+ data: {
244
+ a: replacement[0],
245
+ b: replacement[1]
246
+ },
247
+ fix(fixer) {
248
+ return fixer.replaceTextRange(range, replacement[1]);
249
+ },
250
+ loc,
251
+ messageId: "replacedWith"
252
+ });
253
+ });
254
+ }
255
+ });
256
+ },
257
+ defaultOptions: [],
258
+ meta: {
259
+ docs: {
260
+ description: "disallow the usage of vuetify css classes since they are replaced with tailwindcss",
261
+ recommended: "recommended"
262
+ },
263
+ fixable: "code",
264
+ messages: {
265
+ replacedWith: `'{{ a }}' has been replaced with '{{ b }}'`
266
+ },
267
+ schema: [],
268
+ type: "problem"
269
+ },
270
+ name: RULE_NAME$1
271
+ });
272
+
273
+ const debug = createDebug("@rotki/eslint-plugin:no-deprecated-components");
274
+ const RULE_NAME = "no-deprecated-components";
275
+ const replacements = {
276
+ DataTable: true,
277
+ Fragment: false
278
+ };
279
+ const skipInLegacy = [
280
+ "Fragment"
281
+ ];
282
+ function hasReplacement(tag) {
283
+ return Object.prototype.hasOwnProperty.call(replacements, tag);
284
+ }
285
+ const noDeprecatedComponents = createEslintRule({
286
+ create(context, optionsWithDefault) {
287
+ const options = optionsWithDefault[0] || {};
288
+ const legacy = options.legacy;
289
+ return defineTemplateBodyVisitor(context, {
290
+ VElement(element) {
291
+ const tag = pascalCase(element.rawName);
292
+ const sourceCode = getSourceCode(context);
293
+ if (!("getTemplateBodyTokenStore" in sourceCode.parserServices))
294
+ throw new Error("cannot find getTemplateBodyTokenStore in parserServices");
295
+ if (!hasReplacement(tag))
296
+ return;
297
+ const replacement = replacements[tag];
298
+ if (replacement || legacy && skipInLegacy.includes(tag)) {
299
+ debug(`${tag} has been deprecated`);
300
+ context.report({
301
+ data: {
302
+ name: snakeCase(tag)
303
+ },
304
+ messageId: "deprecated",
305
+ node: element
306
+ });
307
+ } else {
308
+ debug(`${tag} has will be removed`);
309
+ context.report({
310
+ data: {
311
+ name: snakeCase(tag)
312
+ },
313
+ fix(fixer) {
314
+ return [
315
+ fixer.remove(element.startTag),
316
+ ...element.endTag ? [fixer.remove(element.endTag)] : []
317
+ ];
318
+ },
319
+ messageId: "removed",
320
+ node: element
321
+ });
322
+ }
323
+ }
324
+ });
325
+ },
326
+ defaultOptions: [{ legacy: false }],
327
+ meta: {
328
+ docs: {
329
+ description: "Removes deprecated classes that do not exist anymore",
330
+ recommended: "recommended"
331
+ },
332
+ fixable: "code",
333
+ messages: {
334
+ deprecated: `'{{ name }}' has been deprecated`,
335
+ removed: `'{{ name }}' has been removed`,
336
+ replacedWith: `'{{ a }}' has been replaced with '{{ b }}'`
337
+ },
338
+ schema: [
339
+ {
340
+ additionalProperties: false,
341
+ properties: {
342
+ legacy: {
343
+ type: "boolean"
344
+ }
345
+ },
346
+ type: "object"
347
+ }
348
+ ],
349
+ type: "problem"
350
+ },
351
+ name: RULE_NAME
352
+ });
353
+
354
+ const plugin = {
355
+ meta: {
356
+ name: "@rotki/eslint-plugin",
357
+ version: pkg.version
358
+ },
359
+ rules: {
360
+ "no-deprecated-classes": noDeprecatedClasses,
361
+ "no-deprecated-components": noDeprecatedComponents
362
+ }
363
+ };
364
+ const plugin$1 = plugin;
365
+
366
+ function createRecommended(plugin, name, flat) {
367
+ const rules = Object.fromEntries(Object.entries(plugin.rules).filter(([_key, rule]) => rule.meta.recommended === "recommended" && !rule.meta.deprecated).map(([key]) => [`${name}/${key}`, 2]));
368
+ if (flat) {
369
+ return {
370
+ plugins: {
371
+ [name]: plugin
372
+ },
373
+ rules
374
+ };
375
+ } else {
376
+ return {
377
+ plugins: [name],
378
+ rules
379
+ };
380
+ }
381
+ }
382
+
383
+ const configs = {
384
+ "recommended": createRecommended(plugin$1, "@rotki", false),
385
+ "recommended-flat": createRecommended(plugin$1, "@rotki", true)
386
+ };
387
+
388
+ const index = Object.assign(plugin$1, { configs });
389
+
390
+ export { index as default };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@rotki/eslint-plugin",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "packageManager": "pnpm@8.14.1",
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "license": "AGPL-3.0",
7
7
  "bugs": {
8
8
  "url": "https://github.com/rotki/eslint-plugin/issues"
@@ -15,36 +15,49 @@
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
- "main": "dist/index.js",
19
- "types": "dist/index.d.ts",
18
+ "main": "./dist/index.mjs",
19
+ "module": "./dist/index.mjs",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "require": "./dist/index.cjs",
25
+ "import": "./dist/index.mjs"
26
+ }
27
+ },
28
+ "sideEffects": false,
20
29
  "peerDependencies": {
21
- "eslint": "^8.0.0"
30
+ "eslint": "^8.0.0 || ^9.0.0"
22
31
  },
23
32
  "dependencies": {
24
- "@typescript-eslint/utils": "6.18.1",
33
+ "@typescript-eslint/utils": "6.19.0",
34
+ "debug": "4.3.4",
35
+ "eslint-compat-utils": "0.4.1",
25
36
  "jsonc-eslint-parser": "2.4.0",
26
- "vue-eslint-parser": "9.4.0",
37
+ "scule": "1.2.0",
38
+ "vue-eslint-parser": "9.4.1",
27
39
  "yaml-eslint-parser": "1.2.2"
28
40
  },
29
41
  "devDependencies": {
30
- "@commitlint/cli": "18.4.4",
31
- "@commitlint/config-conventional": "18.4.4",
32
- "@rotki/eslint-config": "1.1.2",
33
- "@types/eslint": "8.56.1",
34
- "@types/node": "18",
35
- "@typescript-eslint/eslint-plugin": "6.18.1",
36
- "@typescript-eslint/parser": "6.18.1",
37
- "@typescript-eslint/rule-tester": "6.18.1",
38
- "bumpp": "9.2.1",
42
+ "@commitlint/cli": "18.5.0",
43
+ "@commitlint/config-conventional": "18.5.0",
44
+ "@rotki/eslint-config": "2.3.0",
45
+ "@types/debug": "4.1.12",
46
+ "@types/eslint": "8.56.2",
47
+ "@types/node": "20",
48
+ "@typescript-eslint/eslint-plugin": "6.19.0",
49
+ "@typescript-eslint/parser": "6.19.0",
50
+ "@typescript-eslint/rule-tester": "6.19.0",
51
+ "bumpp": "9.3.0",
39
52
  "eslint": "8.56.0",
40
53
  "husky": "8.0.3",
41
54
  "lint-staged": "15.2.0",
42
- "mocha": "10.2.0",
43
- "nyc": "15.1.0",
44
55
  "rimraf": "5.0.5",
45
56
  "ts-node": "10.9.2",
46
57
  "typescript": "5.3.3",
47
- "vitepress": "1.0.0-rc.36"
58
+ "unbuild": "2.0.0",
59
+ "vitepress": "1.0.0-rc.40",
60
+ "vitest": "1.2.1"
48
61
  },
49
62
  "engines": {
50
63
  "node": ">=18.0.0",
@@ -56,16 +69,16 @@
56
69
  "scripts": {
57
70
  "clean": "rimraf .nyc_output coverage dist docs/.vitepress/dist",
58
71
  "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
59
- "generate": "ts-node scripts/update.ts",
72
+ "generate": "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-rule-docs.ts",
60
73
  "lint": "eslint .",
61
74
  "lint:fix": "eslint . --fix",
62
- "build": "tsc --project ./tsconfig.build.json",
63
- "test": "mocha --require ts-node/register/transpile-only \"./tests/**/*.ts\"",
64
- "test:debug": "mocha --require ts-node/register/transpile-only \"./tests/**/*.ts\"",
65
- "test:coverage": "nyc mocha --require ts-node/register/transpile-only \"./tests/**/*.ts\" --timeout 60000",
66
- "new": "ts-node ./scripts/new-rule.ts",
75
+ "build": "unbuild",
76
+ "dev": "unbuild --stub",
77
+ "test": "vitest",
78
+ "new": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/new-rule.ts",
67
79
  "docs": "vitepress dev docs",
68
- "docs:build": "vitepress build docs",
80
+ "docs:build": "pnpm run generate && vitepress build docs",
81
+ "typecheck": "tsc --noEmit",
69
82
  "release": "bumpp -r --no-push"
70
83
  }
71
84
  }
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- parser: string;
3
- plugins: string[];
4
- };
5
- export = _default;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- parser: require.resolve('vue-eslint-parser'),
4
- plugins: ['@rotki'],
5
- };
@@ -1,18 +0,0 @@
1
- declare const _default: {
2
- extends: string[];
3
- parserOptions: {
4
- ecmaVersion: number;
5
- sourceType: string;
6
- ecmaFeatures: {
7
- jsx: boolean;
8
- };
9
- };
10
- env: {
11
- browser: boolean;
12
- es6: boolean;
13
- };
14
- rules: {
15
- '@rotki/no-deprecated-classes': string;
16
- };
17
- };
18
- export = _default;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- extends: [require.resolve('./base')],
4
- parserOptions: {
5
- ecmaVersion: 2018,
6
- sourceType: 'module',
7
- ecmaFeatures: {
8
- jsx: true,
9
- },
10
- },
11
- env: {
12
- browser: true,
13
- es6: true,
14
- },
15
- rules: {
16
- '@rotki/no-deprecated-classes': 'warn',
17
- },
18
- };
package/dist/configs.d.ts DELETED
@@ -1,24 +0,0 @@
1
- declare const _default: {
2
- base: {
3
- parser: string;
4
- plugins: string[];
5
- };
6
- recommended: {
7
- extends: string[];
8
- parserOptions: {
9
- ecmaVersion: number;
10
- sourceType: string;
11
- ecmaFeatures: {
12
- jsx: boolean;
13
- };
14
- };
15
- env: {
16
- browser: boolean;
17
- es6: boolean;
18
- };
19
- rules: {
20
- '@rotki/no-deprecated-classes': string;
21
- };
22
- };
23
- };
24
- export = _default;
package/dist/configs.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- const base_1 = __importDefault(require("./configs/base"));
6
- const recommended_1 = __importDefault(require("./configs/recommended"));
7
- module.exports = {
8
- base: base_1.default,
9
- recommended: recommended_1.default,
10
- };
package/dist/index.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- const configs_1 = __importDefault(require("./configs"));
6
- const rules_1 = __importDefault(require("./rules"));
7
- module.exports = {
8
- configs: configs_1.default,
9
- rules: rules_1.default,
10
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("../types").RuleModule;
2
- export = _default;
@@ -1,97 +0,0 @@
1
- "use strict";
2
- const index_1 = require("../utils/index");
3
- const rule_1 = require("../utils/rule");
4
- const replacements = [
5
- ['d-block', 'block'],
6
- ['d-flex', 'flex'],
7
- ['flex-column', 'flex-col'],
8
- ['flex-grow-1', 'grow'],
9
- ['flex-grow-0', 'grow-0'],
10
- ['flex-shrink-1', 'shrink'],
11
- ['flex-shrink-0', 'shrink-0'],
12
- [
13
- /^align-(start|end|center|baseline|stretch)$/,
14
- ([align]) => `items-${align}`,
15
- ],
16
- [/^justify-space-(between|around)$/, ([justify]) => `justify-${justify}`],
17
- [
18
- /^align-self-(start|end|center|baseline|auto|strech)$/,
19
- ([align]) => `self-${align}`,
20
- ],
21
- [
22
- /^font-weight-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,
23
- ([weight]) => `font-${weight}`,
24
- ],
25
- [/^text-(capitalize|uppercase|lowercase)$/, ([casing]) => casing],
26
- ];
27
- function isString(replacement) {
28
- return typeof replacement[0] === 'string';
29
- }
30
- function isRegex(replacement) {
31
- return replacement[0] instanceof RegExp;
32
- }
33
- const create = (context) => (0, index_1.defineTemplateBodyVisitor)(context, {
34
- 'VAttribute[key.name="class"]': function (node) {
35
- if (!node.value || !node.value.value) {
36
- return;
37
- }
38
- const classes = node.value.value.split(/\s+/).filter((s) => !!s);
39
- const source = context.getSourceCode();
40
- const replaced = [];
41
- classes.forEach((className) => {
42
- for (const replacement of replacements) {
43
- if (isString(replacement) && replacement[0] === className) {
44
- replaced.push([className, replacement[1]]);
45
- }
46
- if (isRegex(replacement)) {
47
- const matches = (replacement[0].exec(className) || []).slice(1);
48
- const replace = replacement[1];
49
- if (matches.length > 0 && typeof replace === 'function') {
50
- return replaced.push([className, replace(matches)]);
51
- }
52
- }
53
- }
54
- });
55
- replaced.forEach((replacement) => {
56
- if (!node.value) {
57
- return;
58
- }
59
- const idx = node.value.value.indexOf(replacement[0]) + 1;
60
- const range = [
61
- node.value.range[0] + idx,
62
- node.value.range[0] + idx + replacement[0].length,
63
- ];
64
- const loc = {
65
- start: source.getLocFromIndex(range[0]),
66
- end: source.getLocFromIndex(range[1]),
67
- };
68
- context.report({
69
- loc,
70
- messageId: 'replacedWith',
71
- data: {
72
- a: replacement[0],
73
- b: replacement[1],
74
- },
75
- fix(fixer) {
76
- return fixer.replaceTextRange(range, replacement[1]);
77
- },
78
- });
79
- });
80
- },
81
- });
82
- module.exports = (0, rule_1.createRule)({
83
- meta: {
84
- type: 'problem',
85
- docs: {
86
- description: 'disallow the usage of vuetify css classes since they are replaced with tailwindcss',
87
- category: 'Recommended',
88
- url: 'https://rotki.github.io/eslint-plugin/rules/no-deprecated-classes',
89
- recommended: true,
90
- },
91
- messages: {
92
- replacedWith: `'{{ a }}' has been replaced with '{{ b }}'`,
93
- },
94
- fixable: 'code',
95
- },
96
- create,
97
- });