@frsource/eslint-config 1.0.0 → 1.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.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @frsource/eslint-config
2
+
3
+ ESLint configuration files used across the FRSOURCE organization.
4
+
5
+ > Note: this package aims to provide shared configuration for specific languages/frameworks - it does not necesarily setup globals that are specific to your enviroment. [Always remember to add those using ESLint documentation](https://eslint.org/docs/latest/use/configure/language-options#using-configuration-files).
package/index.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { default as typescript, overrides as typescriptOverrides } from "./typescript.mjs";
package/index.mjs CHANGED
@@ -1 +1,4 @@
1
- export { default as typescript } from "./typescript.mjs";
1
+ export {
2
+ default as typescript,
3
+ overrides as typescriptOverrides,
4
+ } from './typescript.mjs';
package/package.json CHANGED
@@ -1,25 +1,34 @@
1
1
  {
2
2
  "name": "@frsource/eslint-config",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "main": "index.mjs",
5
+ "types": "index.d.mts",
5
6
  "type": "module",
6
7
  "dependencies": {
8
+ "@eslint/js": "^9.1.1",
7
9
  "@typescript-eslint/eslint-plugin": "6.11.0",
8
10
  "@typescript-eslint/parser": "6.11.0",
9
- "eslint-config-prettier": "9.1.0"
11
+ "eslint-config-prettier": "9.1.0",
12
+ "globals": "^15.0.0",
13
+ "typescript-eslint": "^7.7.0"
10
14
  },
11
15
  "devDependencies": {
16
+ "@types/eslint": "^8.56.10",
17
+ "eslint": "^9.1.0",
12
18
  "release-it": "^17.2.0",
13
- "@frsource/release-it-config": "1.0.0"
19
+ "typescript": "^5.4.5",
20
+ "@frsource/release-it-config": "1.2.0",
21
+ "@frsource/prettier-config": "1.1.0"
14
22
  },
15
23
  "peerDependencies": {
16
- "eslint": ">= 9"
24
+ "eslint": ">= 9",
25
+ "typescript": ">= 5.0.0"
17
26
  },
18
27
  "homepage": "https://github.com/FRSOURCE/toolkit/",
19
28
  "repository": {
20
29
  "type": "git",
21
30
  "url": "git+https://github.com/FRSOURCE/toolkit.git",
22
- "directory": "packages/eslint"
31
+ "directory": "packages/eslint-config"
23
32
  },
24
33
  "bugs": {
25
34
  "url": "https://github.com/FRSOURCE/toolkit/issues"
@@ -34,7 +43,13 @@
34
43
  "eslint",
35
44
  "eslintconfig"
36
45
  ],
46
+ "funding": "https://buymeacoffee.com/frsource",
37
47
  "scripts": {
38
- "release": "release-it"
48
+ "build": "tsc index.mjs --declaration --emitDeclarationOnly --allowJs --moduleResolution bundler --target esnext",
49
+ "release": "release-it",
50
+ "eslint": "eslint .",
51
+ "prettier": "prettier . --check",
52
+ "lint": "pnpm eslint && pnpm prettier",
53
+ "fix": "pnpm eslint --fix && prettier . --write"
39
54
  }
40
55
  }
@@ -0,0 +1,4 @@
1
+ /** @type { import("eslint").Linter.FlatConfig[] } */
2
+ export const overrides: import("eslint").Linter.FlatConfig[];
3
+ declare const _default: typeof import("typescript-eslint")['config'];
4
+ export default _default;
package/typescript.mjs CHANGED
@@ -1,47 +1,60 @@
1
- export default [
1
+ import prettier from 'eslint-config-prettier';
2
+ import js from '@eslint/js';
3
+ import ts from 'typescript-eslint';
4
+ import globals from 'globals';
5
+ import { env } from 'node:process';
6
+
7
+ /** @type { import("eslint").Linter.FlatConfig[] } */
8
+ export const overrides = [
2
9
  {
3
- root: true,
4
- env: {
5
- browser: true,
6
- es2021: true,
7
- node: true,
8
- },
9
- parserOptions: {
10
- parser: "@typescript-eslint/parser",
11
- ecmaVersion: "latest",
12
- sourceType: "module",
13
- },
14
- extends: ["prettier"],
15
- plugins: ["@typescript-eslint", "prettier"],
16
10
  rules: {
17
- "prettier/prettier": [
18
- "error",
19
- {
20
- tabWidth: 2,
21
- },
22
- ],
23
- "@typescript-eslint/semi": 2,
11
+ '@typescript-eslint/semi': 2,
24
12
  semi: 0,
25
13
  curly: 0,
26
- indent: ["off", 2, { offsetTernaryExpressions: true }],
27
- "comma-dangle": "off",
28
- "arrow-parens": [
29
- "off",
30
- "as-needed",
14
+ indent: ['off', 2, { offsetTernaryExpressions: true }],
15
+ 'comma-dangle': 'off',
16
+ 'arrow-parens': [
17
+ 'off',
18
+ 'as-needed',
31
19
  {
32
20
  requireForBlockBody: true,
33
21
  },
34
22
  ],
35
- "space-before-function-paren": [
36
- "error",
23
+ 'space-before-function-paren': [
24
+ 'error',
37
25
  {
38
- anonymous: "always",
39
- named: "never",
40
- asyncArrow: "always",
26
+ anonymous: 'always',
27
+ named: 'never',
28
+ asyncArrow: 'always',
41
29
  },
42
30
  ],
43
- "func-call-spacing": 0,
44
- "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
31
+ 'func-call-spacing': 0,
32
+ 'no-debugger': env.NODE_ENV === 'production' ? 'error' : 'off',
33
+ },
34
+ },
35
+ {
36
+ files: [
37
+ '.*.{js,cjs,mjs,ts,mts,tsx,jsx}',
38
+ '*.config.{js,cjs,mjs,ts,mts,tsx,jsx}',
39
+ ],
40
+ languageOptions: {
41
+ globals: {
42
+ ...globals.node,
43
+ },
44
+ },
45
+ },
46
+ {
47
+ files: ['**/*.cjs'],
48
+ rules: {
49
+ '@typescript-eslint/no-var-requires': 'off',
45
50
  },
46
51
  },
47
52
  ];
53
+
54
+ /** @type {import('typescript-eslint')['config']} */
55
+ export default ts.config(
56
+ js.configs.recommended,
57
+ ...ts.configs.strict,
58
+ prettier,
59
+ ...overrides,
60
+ );