10.0.1 • Published 2 months ago

@ouc/eslint-config v10.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
2 months ago

@ouc/eslint-config

This is the ESLint config of @OUC

Dependencies

This config is based on eslint-config-airbnb-typescript.

Installing it

In your new project, do:

npm i --save-dev    @ouc/eslint-config \
                    @typescript-eslint/eslint-plugin@7 \
                    @typescript-eslint/parser@7 \
                    @commitlint/cli@19 \
                    @commitlint/config-conventional@19 \
                    husky@10 \
                    eslint@8 \
                    eslint-config-airbnb@19 \
                    eslint-config-airbnb-typescript@18 \
                    eslint-config-async@2 \
                    eslint-config-prettier@9 \
                    eslint-import-resolver-typescript@3 \
                    eslint-plugin-es5@1 \
                    eslint-plugin-es-x@7 \
                    eslint-plugin-import@2 \
                    eslint-plugin-ie11@1 \
                    eslint-plugin-jsx-a11y@6 \
                    eslint-plugin-prettier@5 \
                    eslint-plugin-react@7 \
                    eslint-plugin-react-hooks@4 \
                    prettier@3 \
                    scriptlint@3 \
                    typescript@5 \
                    npm-run-all@4

Create the following files in your new project:

.eslintrc.js

module.exports = {
  extends: ["@ouc/eslint-config"],
  parserOptions: {
    project: "./tsconfig.eslint.json",
  },
};

.eslintignore

node_modules
dist
volumes
# and whatever else you might want to exclude that has JS/TS files inside

.prettierrc.js

const config = require("@ouc/eslint-config/.prettierrc");

module.exports = config;

.scriptlintrc.js

const config = require("@ouc/eslint-config/.scriptlintrc");

module.exports = config;

commitlint.config.js

const config = require("@ouc/eslint-config/commitlint.config");

module.exports = config;

tsconfig.eslint.json

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            // make sure to include all the paths here that you also specified in your default tsconfig.json!
        }
    },
    "exclude": [
        "node_modules",
    ],
    "include": [
        ".eslintrc.js",
        "*.js",
        "*.ts",
        "**/*.js",
        "**/*.ts",
    ]
}

Using it

Create the tasks in your package.json, e.g.

{
    "scripts": {
        "lint": "run-p lint:scriptlint lint:eslint",
        "lint:commitlint": "commitlint --edit",
        "lint:eslint": "eslint --ext .js,.ts .",
        "lint:eslint:fix": "eslint --ext .js,.ts . --fix",
        "lint:scriptlint": "scriptlint"
    },
}

and create the following husky scripts:

npx husky-init

cp node_modules/@ouc/eslint-config/.husky/commit-msg .husky/commit-msg
cp node_modules/@ouc/eslint-config/.husky/pre-commit .husky/pre-commit
cp node_modules/@ouc/eslint-config/.husky/pre-push .husky/pre-push
chmod +x .husky/commit-msg .husky/pre-commit .husky/pre-push

and start using it :)

10.0.0

2 months ago

10.0.1

2 months ago

8.0.1

9 months ago

9.0.2

6 months ago

9.0.1

6 months ago

9.0.0

6 months ago

7.7.1

12 months ago

7.7.0

12 months ago

7.6.0

12 months ago

8.0.0

11 months ago

7.4.0

1 year ago

7.3.0

1 year ago

7.2.0

1 year ago

7.1.0

1 year ago

7.5.2

1 year ago

7.5.0

1 year ago

7.0.0

1 year ago

6.1.4

2 years ago

6.1.3

2 years ago

6.1.2

2 years ago

6.1.0

2 years ago

6.0.0

2 years ago

6.1.1

2 years ago

5.2.1

3 years ago

5.2.0

3 years ago

5.1.0

3 years ago

5.0.0

3 years ago

4.1.2

3 years ago

4.1.0

3 years ago

4.1.1

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago