@switz/eslint-config 12.0.6 → 12.1.1

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 CHANGED
@@ -1,58 +1,45 @@
1
- # switz's eslint-config
2
-
3
- ## Motivation
4
-
5
- I've had this lying around in my home dir `~/.eslintrc.js` for a while and decided to package it up so I can override it in project settings (e.g. targets) and include it in my personal projects.
1
+ HI
6
2
 
7
- You probably have your own preferences, feel free to hack and slash it.
3
+ # switz's eslint-config
8
4
 
9
5
  ## Installation
10
6
 
11
7
  ```
12
- # yarn add eslint
13
- $ yarn add -D @switz/eslint-config
8
+ $ yarn add -D eslint @switz/eslint-config
14
9
  # or
15
- $ npm install -D @switz/eslint-config
10
+ $ pnpm install -D eslint @switz/eslint-config
16
11
  ```
17
12
 
18
- Update your eslint config (`.eslintrc` or `.eslintrc.js`):
13
+ Update your eslint config (`eslint.config.mjs`)
19
14
 
20
15
  ```
21
- {
22
- "extends": [
23
- "@switz/eslint-config"
24
- ]
25
- }
16
+ import main from '@switz/eslint-config';
17
+
18
+ export default [...main];
26
19
  ```
27
20
 
28
21
  If you need React support, use
29
22
 
30
23
  ```
31
- {
32
- "extends": [
33
- "@switz/eslint-config/react.cjs"
34
- ]
35
- }
24
+ import react from '@switz/eslint-config/react';
25
+
26
+ export default [...react];
36
27
  ```
37
28
 
38
- Or node:
29
+ Or typescript:
39
30
 
40
31
  ```
41
- {
42
- "extends": [
43
- "@switz/eslint-config/node.cjs"
44
- ]
45
- }
32
+ import typescript from '@switz/eslint-config/typescript';
33
+
34
+ export default [...typescript];
46
35
  ```
47
36
 
48
- Or typescript:
37
+ Or tailwind:
49
38
 
50
39
  ```
51
- {
52
- "extends": [
53
- "@switz/eslint-config/typescript.cjs"
54
- ]
55
- }
40
+ import tailwind from '@switz/eslint-config/tailwind';
41
+
42
+ export default [...tailwind];
56
43
  ```
57
44
 
58
45
  ## Reference
package/eslint.config.mjs CHANGED
@@ -1,7 +1,16 @@
1
+ import globals from 'globals';
1
2
  import js from '@eslint/js';
2
3
  import prettierPlugin from 'eslint-plugin-prettier/recommended';
3
4
 
4
5
  export default [
6
+ {
7
+ languageOptions: {
8
+ globals: {
9
+ ...globals.browser,
10
+ ...globals.nodeBuiltin,
11
+ },
12
+ },
13
+ },
5
14
  js.configs.recommended,
6
15
  {
7
16
  files: ['**/*.{js,jsx,ts,tsx}'],
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@switz/eslint-config",
3
- "version": "12.0.6",
3
+ "version": "12.1.1",
4
4
  "description": "",
5
- "main": "eslintrc.cjs",
5
+ "main": "eslint.config.mjs",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -20,6 +20,7 @@
20
20
  "eslint-plugin-prettier": "^5.1.3",
21
21
  "eslint-plugin-react": "^7.34.2",
22
22
  "eslint-plugin-tailwindcss": "^3.17.0",
23
+ "globals": "^16.0.0",
23
24
  "prettier": "3.5.3",
24
25
  "prettier-plugin-tailwindcss": "^0.6.11",
25
26
  "typescript-eslint": "^8.29.0"
package/react.mjs CHANGED
@@ -1,10 +1,12 @@
1
1
  import react from 'eslint-plugin-react';
2
2
  import main from './eslint.config.mjs';
3
+ import tailwind from './tailwind.mjs';
3
4
 
4
5
  export default [
5
- ...main,
6
6
  react.configs.flat.recommended,
7
7
  react.configs.flat['jsx-runtime'],
8
+ ...main,
9
+ ...tailwind,
8
10
  {
9
11
  rules: {
10
12
  'react/display-name': 'off',
package/tailwind.mjs CHANGED
@@ -1,4 +1,3 @@
1
1
  import eslintPluginTailwindCSS from 'eslint-plugin-tailwindcss';
2
- import main from './eslint.config.mjs';
3
2
 
4
- export default [main, eslintPluginTailwindCSS.configs['flat/recommended']];
3
+ export default [eslintPluginTailwindCSS.configs['flat/recommended']];