Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up linting #227

Draft
wants to merge 22 commits into
base: v5
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7c28120
refactor: move src file to src/
RebeccaStevens Nov 12, 2020
79b3837
refactor: move typedefs to types/
RebeccaStevens Nov 12, 2020
86d9338
build: setup for convertion to typescript
RebeccaStevens Jan 21, 2021
85cf74e
build: remove manual typings
RebeccaStevens Jan 21, 2021
96dc11d
refactor: adjust code style
RebeccaStevens Jan 21, 2021
55865c7
refactor: move implementation out of index file
RebeccaStevens Jan 21, 2021
795e78b
refactor: move utility functions to an utils file
RebeccaStevens Jan 21, 2021
b1aacd5
refactor: move options functions to an options file
RebeccaStevens Jan 21, 2021
64a3075
perf: only compute the full options on the top level call
RebeccaStevens Jan 21, 2021
64d6d2a
feat: add types
RebeccaStevens Jan 21, 2021
2e50315
test: typescript types
RebeccaStevens Jan 22, 2021
7b9b5b5
fix: add legacy types for older version of typescript
RebeccaStevens Jan 22, 2021
0538453
test: initial conversion of test to typescript
RebeccaStevens Jan 23, 2021
4583214
test: get tests working
RebeccaStevens Jan 23, 2021
e037872
test: remove duplicate test
RebeccaStevens Jan 23, 2021
1e84f1a
test: move mergeAll test to merge-all test file
RebeccaStevens Jan 23, 2021
7c537a1
test: upgrade and fix test code
RebeccaStevens Jan 23, 2021
0a5a3c3
fix: remove mutating of target with clone=false
RebeccaStevens Jan 23, 2021
887c988
test: update test to work with new default behavior of clone=false
RebeccaStevens Jan 23, 2021
678eda3
refactor: rename merge and mergeAll to deepmerge and deepmergeAll
RebeccaStevens Jan 23, 2021
254d50c
docs: update readme
RebeccaStevens Jan 23, 2021
0b9c421
build: set up js linting
RebeccaStevens Jan 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 10,
"ecmaFeatures": {
"impliedStrict": true
},
"sourceType": "module"
},
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended"
],
"ignorePatterns": ["dist", "types"],
"rules": {
"no-extra-boolean-cast": "error",
"array-bracket-spacing": [
"error",
"always",
{
"objectsInArrays": false
}
],
"block-spacing": ["error", "always"],
"brace-style": "error",
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"comma-style": "error",
"curly": "error",
"computed-property-spacing": ["error", "never"],
"func-call-spacing": ["error", "never"],
"indent": ["error", "tab"],
"key-spacing": "error",
"keyword-spacing": "error",
"no-whitespace-before-property": "error",
"no-trailing-spaces": "error",
"object-curly-spacing": ["error", "always"],
"padded-blocks": ["error", "never"],
"semi": ["error", "never"],
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": [
"error",
{
"words": true,
"nonwords": false
}
],
"no-regex-spaces": "error",
"no-unsafe-negation": "error",
"dot-location": ["error", "property"],
"dot-notation": "error",
"no-extra-label": "error",
"no-multi-spaces": [
"error",
{
"exceptions": {
"Property": false
}
}
],
"no-useless-return": "error",
"eol-last": ["error", "always"],
"linebreak-style": "error",
"no-lonely-if": "error",
"no-unneeded-ternary": "error",
"object-curly-newline": [
"error",
{
"consistent": true
}
],
"operator-linebreak": ["error", "before"],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "backtick"],
"space-before-blocks": ["error", "always"],
"spaced-comment": ["error", "always"],
"template-tag-spacing": "error",
"unicode-bom": "error",
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": ["error", "always"],
"arrow-spacing": "error",
"generator-star-spacing": "error",
"no-useless-computed-key": "error",
"no-useless-rename": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": true
}
],
"prefer-const": "error",
"prefer-numeric-literals": "error",
"prefer-spread": "error",
"rest-spread-spacing": "error",
"template-curly-spacing": ["error", "always"],

"no-bitwise": "error",
"no-console": "off",
"no-debugger": "off",
"no-empty": "error",
"no-inner-declarations": "off",
"no-undef": "error",
"no-unused-vars": "warn"
},
"overrides": [
{
"files": [
"**/*.ts"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"./tsconfig.base.json",
"./tsconfig.json",
"./tsconfig.typedef.json",
"./test/tsconfig.json"
]
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"rules": {
"@typescript-eslint/array-type": [
"error",
{
"default": "generic"
}
],
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"Object": {
"message": "Use object instead",
"fixWith": "object"
},
"object": false,
"{}": false
},
"extendDefaults": true
}
],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/prefer-interface": "off",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars-experimental": [
"warn",
{
"ignoredNamesRegex": "^_",
"ignoreArgsIfArgsAfterAreUsed": true
}
],
"@typescript-eslint/no-use-before-define": [
"error",
{
"functions": false,
"variables": true
}
],

"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/unified-signatures": "warn",

"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off"
}
},
{
"files": [
"**/test/**/*",
"**/*test.ts"
],
"rules": {
"no-unused-vars": "off",

"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/restrict-template-expressions": "off"
}
}
]
}
35 changes: 18 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@ on:
- pull_request

jobs:
# lint:
# name: Linting Checks
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2

# - name: Setup NodeJs
# uses: actions/setup-node@v1
# with:
# node-version: "14"

# - name: Install Dependencies
# run: npm ci

# - name: Run Linting Checks
# run: npm run lint
lint:
name: Linting Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup NodeJs
uses: actions/setup-node@v1
with:
node-version: "14"

- name: Install Dependencies
run: npm ci

- name: Run Linting Checks
run: npm run lint

test:
strategy:
fail-fast: true
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist/*
/node_modules
/dist/*
/types/current/*
16 changes: 0 additions & 16 deletions index.d.ts

This file was deleted.

117 changes: 0 additions & 117 deletions index.js

This file was deleted.

Loading