@evaneos/front-config 0.0.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 ADDED
@@ -0,0 +1,45 @@
1
+ # @evaneos/front-config
2
+
3
+ @evaneos/front-config is the main resource for shared js/ts/tsx linting and config across Evaneos apps.
4
+
5
+ ## Instal
6
+
7
+ ```shell
8
+ npm install @evaneos/front-config@latest
9
+ ```
10
+
11
+ # Usage
12
+
13
+ ## Eslint
14
+
15
+ In your `.eslintrc` file, add:
16
+
17
+ ```json
18
+ {
19
+ "extends": ["@evaneos/front-config/linting/eslint-config"],
20
+ "parserOptions": {
21
+ "project": ["./tsconfig.json"]
22
+ }
23
+ }
24
+ ```
25
+
26
+ ## TSConfig
27
+
28
+ In your `tsconfig.json` file, add:
29
+
30
+ ```json
31
+ {
32
+ "extends": "@evaneos/front-config/config/tsconfig.json"
33
+ }
34
+ ```
35
+
36
+ ## Prettier
37
+
38
+ In your `.prettierrc` file add:
39
+
40
+ ```js
41
+ module.exports = {
42
+ ...require("@evaneos/front-config/linting/prettier-config.js"),
43
+ semi: false,
44
+ };
45
+ ```
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es6",
4
+ "lib": ["dom", "esnext"],
5
+ "jsx": "react",
6
+ "noEmit": true,
7
+ "isolatedModules": true,
8
+ "strict": true,
9
+ "noImplicitAny": true,
10
+ "module": "es2020",
11
+ "moduleResolution": "node",
12
+ "esModuleInterop": true,
13
+ "skipLibCheck": true,
14
+ "resolveJsonModule": true
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ module.exports = {
2
+ parser: '@babel/eslint-parser',
3
+ env: {
4
+ browser: true,
5
+ es6: true,
6
+ },
7
+ extends: [
8
+ 'eslint:recommended',
9
+ require.resolve('./rules/override'),
10
+ require.resolve('./rules/react'),
11
+ require.resolve('./rules/style'),
12
+ require.resolve('./rules/test'),
13
+ require.resolve('./rules/prettier'),
14
+ ],
15
+ };
@@ -0,0 +1,19 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ plugins: ['@typescript-eslint'],
4
+ extends: [
5
+ '@evaneos/eslint-config-base',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'plugin:import/typescript',
8
+ '@evaneos/eslint-config-base/prettier',
9
+ ],
10
+ settings: {
11
+ 'import/extensions': [ '.js', '.jsx', '.css', '.ts', '.tsx' ],
12
+ },
13
+ rules: {
14
+ '@typescript-eslint/ban-ts-comment': 0,
15
+ '@typescript-eslint/camelcase': 0,
16
+ '@typescript-eslint/no-floating-promises': 'error',
17
+ '@typescript-eslint/no-unused-vars': [ 'error', { 'ignoreRestSiblings': true } ],
18
+ },
19
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ tabWidth: 4,
3
+ singleQuote: true,
4
+ };
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ plugins: ['import'],
3
+ rules: {
4
+ 'import/no-default-export': 2,
5
+ 'no-process-env': 0,
6
+ 'prefer-const': 1,
7
+ 'prefer-destructuring': 1,
8
+ 'prefer-spread': 1,
9
+ 'arrow-body-style': 0,
10
+ },
11
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: ['eslint-config-prettier'],
3
+ };
@@ -0,0 +1,17 @@
1
+ module.exports = {
2
+ plugins: ['react-hooks'],
3
+ extends: ['plugin:react/recommended'],
4
+ settings: {
5
+ react: {
6
+ version: 'detect',
7
+ },
8
+ 'import/extensions': ['.js', '.jsx', '.css'],
9
+ },
10
+ rules: {
11
+ 'react-hooks/exhaustive-deps': 1,
12
+ 'react-hooks/rules-of-hooks': 2,
13
+ 'react/display-name': 0,
14
+ 'react/prop-types': 0,
15
+ 'react/react-in-jsx-scope': 0,
16
+ },
17
+ };
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ rules: {
3
+ 'import/newline-after-import': 1,
4
+ 'import/no-duplicates': 2,
5
+ 'import/order': [
6
+ 'warn',
7
+ {
8
+ alphabetize: {
9
+ order: 'asc',
10
+ caseInsensitive: true,
11
+ },
12
+ 'newlines-between': 'always',
13
+ },
14
+ ],
15
+ },
16
+ };
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ overrides: [
3
+ {
4
+ files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
5
+ extends: ['plugin:testing-library/react'],
6
+ }
7
+ ]
8
+ }
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@evaneos/front-config",
3
+ "version": "0.0.1",
4
+ "engines": {
5
+ "node": ">=v18",
6
+ "npm": ">=9"
7
+ },
8
+ "files": [
9
+ "linting/*",
10
+ "config/*",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "prepare": "husky"
15
+ },
16
+ "devDependencies": {
17
+ "@commitlint/cli": "^19.4.0",
18
+ "@commitlint/config-conventional": "^19.2.2",
19
+ "commitlint-plugin-function-rules": "^4.0.0",
20
+ "husky": "^9.1.4"
21
+ }
22
+ }