Skip to content

Commit 91528fe

Browse files
committed
feat: initial commit
0 parents  commit 91528fe

File tree

10 files changed

+1798
-0
lines changed

10 files changed

+1798
-0
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Check Formatting
2+
on:
3+
- push
4+
- pull_request
5+
6+
jobs:
7+
check-formatting:
8+
name: Check Formatting
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: '14'
19+
20+
- name: Cache pnpm modules
21+
uses: actions/cache@v2
22+
env:
23+
cache-name: cache-pnpm-modules
24+
with:
25+
path: ~/.pnpm-store
26+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
29+
30+
- uses: pnpm/[email protected]
31+
with:
32+
version: 6
33+
run_install: true
34+
35+
- name: Check formatting
36+
run: pnpm run format

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

.prettierrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
tabWidth: 2,
7+
endOfLine: 'lf',
8+
};

index.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: ['./tsconfig.eslint.json'],
5+
sourceType: 'module',
6+
ecmaVersion: 2018,
7+
tsconfigRootDir: __dirname,
8+
},
9+
plugins: ['@typescript-eslint', 'import', 'simple-import-sort'],
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:@typescript-eslint/recommended',
13+
'plugin:prettier/recommended',
14+
'plugin:import/errors',
15+
'plugin:import/warnings',
16+
'plugin:import/typescript',
17+
'plugin:promise/recommended',
18+
],
19+
rules: {
20+
// make typescript eslint rules even more strict
21+
'@typescript-eslint/no-explicit-any': 'error',
22+
'@typescript-eslint/no-unused-vars': 'error',
23+
'@typescript-eslint/explicit-module-boundary-types': 'error',
24+
'@typescript-eslint/no-non-null-assertion': 'error',
25+
'no-shadow': 'off',
26+
'@typescript-eslint/no-shadow': ['error'],
27+
28+
'import/no-unresolved': 'off', // disable as this is handled by tsc itself
29+
'import/first': 'error',
30+
'import/newline-after-import': 'error',
31+
'import/no-cycle': 'error',
32+
'import/no-relative-parent-imports': 'error',
33+
'import/no-duplicates': 'error',
34+
'import/no-extraneous-dependencies': 'error',
35+
36+
'simple-import-sort/imports': 'error',
37+
'simple-import-sort/exports': 'error',
38+
39+
'promise/prefer-await-to-then': 'error',
40+
'promise/prefer-await-to-callbacks': 'error',
41+
42+
'no-else-return': ['error', { allowElseIf: false }],
43+
'no-return-assign': ['error', 'always'],
44+
'no-return-await': 'error',
45+
'no-useless-return': 'error',
46+
'no-restricted-imports': [
47+
'error',
48+
{
49+
patterns: ['src', 'dist'],
50+
},
51+
],
52+
'arrow-body-style': 'error',
53+
'prettier/prettier': 'error',
54+
'no-console': 'warn',
55+
'no-useless-concat': 'error',
56+
curly: ['error'],
57+
},
58+
overrides: [
59+
{
60+
files: ['**/*.js'],
61+
rules: {
62+
'@typescript-eslint/no-var-requires': 'off',
63+
},
64+
},
65+
{
66+
files: ['**/*.{ts,vue}'],
67+
extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'],
68+
},
69+
],
70+
reportUnusedDisableDirectives: true,
71+
};

jest.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
settings: {
3+
jest: {
4+
version: 26,
5+
},
6+
},
7+
overrides: [
8+
{
9+
files: ['test/**/*'],
10+
env: {
11+
jest: true, // now **/*.test.js files' env has both es6 *and* jest
12+
},
13+
extends: ['plugin:jest/all'],
14+
rules: {
15+
'@typescript-eslint/unbound-method': 'off',
16+
'jest/unbound-method': 'error',
17+
'jest/prefer-expect-assertions': ['error', { onlyFunctionsWithAsyncKeyword: true }],
18+
'jest/lowercase-name': ['error', { ignore: ['describe'] }],
19+
'jest/no-hooks': 'off',
20+
},
21+
},
22+
],
23+
};

package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "@geprog/eslint-config",
3+
"version": "0.0.1",
4+
"description": "ESLint config for Typescript, Vue.js and Jest",
5+
"homepage": "https://geprog.com",
6+
"repository": "github:geprog/eslint-config",
7+
"license": "MIT",
8+
"files": [
9+
"/index.js",
10+
"/jest.js",
11+
"/vue.js",
12+
"/patch"
13+
],
14+
"scripts": {
15+
"format": "prettier --check .",
16+
"format:fix": "prettier --write ."
17+
},
18+
"dependencies": {
19+
"@intlify/eslint-plugin-vue-i18n": "0.11.0",
20+
"@rushstack/eslint-patch": "^1.0.6",
21+
"@typescript-eslint/eslint-plugin": "4.24.0",
22+
"@typescript-eslint/parser": "4.24.0",
23+
"@vue/eslint-config-prettier": "6.0.0",
24+
"@vue/eslint-config-typescript": "7.0.0",
25+
"eslint-config-prettier": "8.1.0",
26+
"eslint-plugin-import": "2.22.1",
27+
"eslint-plugin-jest": "24.3.1",
28+
"eslint-plugin-prettier": "3.3.1",
29+
"eslint-plugin-promise": "4.3.1",
30+
"eslint-plugin-simple-import-sort": "7.0.0",
31+
"eslint-plugin-vue": "7.9.0",
32+
"eslint-plugin-vue-scoped-css": "1.1.0",
33+
"vue-eslint-parser": "7.6.0"
34+
},
35+
"devDependencies": {
36+
"prettier": "2.3.0"
37+
},
38+
"peerDependencies": {
39+
"eslint": ">= 7"
40+
}
41+
}

patch/modern-module-resolution.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
require('@rushstack/eslint-patch/modern-module-resolution');

0 commit comments

Comments
 (0)