@rotki/eslint-config 1.1.2 → 2.0.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/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @rotki/eslint-config
2
+
3
+ [![npm (scoped)](https://img.shields.io/npm/v/@rotki/eslint-config?style=flat-square)](https://www.npmjs.com/package/@rotki/eslint-config)
4
+
5
+ Inspired by [@antfu/eslint-config](https://github.com/antfu/eslint-config) and [@sxzz/eslint-config](https://github.com/sxzz/eslint-config).
6
+
7
+ A common configuration to be used across the different [rotki](https://github.com/rotki) TypeScript and JavaScript repositories.
8
+
9
+ ## Usage
10
+
11
+ ### Install
12
+
13
+ ```
14
+ pnpm i -D eslint @rotki/eslint-config
15
+ ```
16
+
17
+ ### Config `eslint.config.js`
18
+
19
+ With `"type":"module"`
20
+
21
+ ```js
22
+ import rotki from '@rotki/eslint-config';
23
+
24
+ // eslint-disable-next-line import/no-default-export
25
+ export default rotki();
26
+ ```
27
+
28
+ With CommonJS
29
+
30
+ ```js
31
+ const rotki = require('@rotki/eslint-config').default;
32
+
33
+ module.exports = rotki();
34
+ ```
35
+
36
+ ### Add script for package.json
37
+
38
+ For example:
39
+
40
+ ```json
41
+ {
42
+ "scripts": {
43
+ "lint": "eslint .",
44
+ "lint:fix": "eslint . --fix"
45
+ }
46
+ }
47
+ ```
48
+
49
+ ### @intlify/eslint-plugin-vue-i18n
50
+
51
+ ```js
52
+ // eslint.config.js
53
+ import rotki from '@rotki/eslint-config';
54
+
55
+ // eslint-disable-next-line import/no-default-export
56
+ export default rotki({
57
+ vueI18n: {
58
+ src: path.join('app', 'src'), // defaults to src for @intlify/vue-i18n/no-unused-keys,
59
+ localeDir: 'locales', // that would be under app/src/
60
+ ignores: [], // for @intlify/vue-i18n/no-unused-keys
61
+ },
62
+ });
63
+ ```
64
+
65
+ ### TypeScript Aware Rules
66
+
67
+ ```js
68
+ // eslint.config.js
69
+ import rotki from '@rotki/eslint-config';
70
+
71
+ // eslint-disable-next-line import/no-default-export
72
+ export default rotki({
73
+ typescript: {
74
+ tsconfigPath: 'tsconfig.json',
75
+ },
76
+ });
77
+ ```
78
+
79
+ ## License
80
+
81
+ [AGPL-3.0](./LICENSE) License © 2023- [Rotki Solutions GmbH](https://github.com/rotki)