@averay/codeformat 0.1.1 → 0.1.3

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 (3) hide show
  1. package/README.md +14 -14
  2. package/eslint.config.js +12 -6
  3. package/package.json +19 -5
package/README.md CHANGED
@@ -8,20 +8,20 @@ A very opinionated collection of configurations for a number of code formatting
8
8
 
9
9
  2. Symlink the static configuration files to the project root:
10
10
 
11
- ```sh
12
- ln -s node_modules/@averay/codeformat/.editorconfig node_modules/@averay/codeformat/.prettierrc.json ./
13
- ```
11
+ ```sh
12
+ ln -s node_modules/@averay/codeformat/.editorconfig node_modules/@averay/codeformat/.prettierrc.json ./
13
+ ```
14
14
 
15
15
  3. Generate the ESLint configuration after any custom ignore definitions:
16
16
 
17
- ```js
18
- // eslint.config.js
19
- import { makeEslintConfig } from '@adamaveray/codeformat';
20
-
21
- export default [
22
- {
23
- ignores: ['dist/**/*'],
24
- },
25
- ...makeEslintConfig({ tsconfigPath: './tsconfig.json' }),
26
- ];
27
- ```
17
+ ```js
18
+ // eslint.config.js
19
+ import { makeEslintConfig } from '@averay/codeformat';
20
+
21
+ export default [
22
+ {
23
+ ignores: ['dist/**/*'],
24
+ },
25
+ ...makeEslintConfig({ tsconfigPath: './tsconfig.json' }),
26
+ ];
27
+ ```
package/eslint.config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { FlatCompat } from '@eslint/eslintrc';
2
2
  import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
+ import js from '@eslint/js';
4
5
  import typescript from '@typescript-eslint/eslint-plugin';
5
6
  import typescriptParser from '@typescript-eslint/parser';
6
7
  import prettierConfig from 'eslint-config-prettier';
@@ -8,17 +9,22 @@ import prettierConfig from 'eslint-config-prettier';
8
9
  const compat = new FlatCompat({ baseDirectory: path.dirname(fileURLToPath(import.meta.url)) });
9
10
 
10
11
  export default [
11
- 'eslint:recommended',
12
- prettierConfig,
13
- ...compat.plugins('@typescript-eslint'),
14
- { files: ['**/*.{js,jsx,cjs,cjsx,mjs,mjsx}'] },
15
12
  {
16
- files: ['**/*.{ts,tsx}'],
13
+ files: ['**/*.{js,jsx,cjs,cjsx,mjs,mjsx}'],
14
+ rules: js.configs.recommended.rules,
15
+ },
16
+ {
17
+ ...compat.plugins('@typescript-eslint')[0],
18
+ files: ['**/*.{ts,tsx,cts,ctsx,mts,mtsx}'],
17
19
  languageOptions: { parser: typescriptParser },
18
20
  rules: {
19
- ...typescript.configs.base.rules,
21
+ ...js.configs.recommended.rules,
20
22
  ...typescript.configs['eslint-recommended'].rules,
23
+ ...typescript.configs.recommended.rules,
24
+ ...typescript.configs['recommended-requiring-type-checking'].rules,
21
25
  ...typescript.configs.strict.rules,
26
+ '@typescript-eslint/no-explicit-any': 'off',
22
27
  },
23
28
  },
29
+ prettierConfig,
24
30
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@averay/codeformat",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "author": "Adam Averay (https://adamaveray.com.au/)",
5
5
  "homepage": "https://github.com/adamaveray/codeformat",
6
6
  "repository": {
@@ -20,11 +20,25 @@
20
20
  "eslint.config.js",
21
21
  "index.js"
22
22
  ],
23
+ "scripts": {
24
+ "format": "prettier --write .",
25
+ "lint": "prettier --check .",
26
+ "prepare": "husky install"
27
+ },
28
+ "husky": {
29
+ "hooks": {
30
+ "pre-push": "npm run lint"
31
+ }
32
+ },
23
33
  "dependencies": {
24
- "@eslint/eslintrc": "^1.4.1",
25
- "@typescript-eslint/eslint-plugin": "^5.50.0",
26
- "@typescript-eslint/parser": "^5.50.0",
34
+ "@eslint/eslintrc": "^2.0.0",
35
+ "@eslint/js": "^8.35.0",
36
+ "@typescript-eslint/eslint-plugin": "^5.54.0",
37
+ "@typescript-eslint/parser": "^5.54.0",
27
38
  "eslint-config-prettier": "^8.6.0",
28
- "prettier": "^2.8.3"
39
+ "prettier": "^2.8.4"
40
+ },
41
+ "devDependencies": {
42
+ "husky": "^8.0.3"
29
43
  }
30
44
  }