Skip to content

Commit

Permalink
Merge pull request #30 from jonataswalker/up-deps
Browse files Browse the repository at this point in the history
flat config
  • Loading branch information
jonataswalker committed Feb 28, 2024
2 parents 2e727a5 + e4d0864 commit 99748f6
Show file tree
Hide file tree
Showing 25 changed files with 3,587 additions and 5,272 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.husky
.vscode

eslint.config.js
.prettierrc
jsconfig.json
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"printWidth": 120,
"singleQuote": true,
"useTabs": false,
"semi": false,
"bracketSpacing": true,
"quoteProps": "as-needed",
"trailingComma": "es5",
Expand Down
84 changes: 76 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,83 @@
{
"editor.formatOnSave": true,
"editor.rulers": [100, 120],
"editor.formatOnPaste": false,
"eslint.experimental.useFlatConfig": true,
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"typescript.tsdk": "node_modules/typescript/lib",
"javascript.updateImportsOnFileMove.enabled": "always",
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true,
"**/*.code-search": true
},

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "always"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml"
],

"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"[css]": {
"editor.wordWrap": "off"
},
"[properties]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll": "never"
},
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"[yaml]": {
"editor.autoIndent": "advanced"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"[dockercompose]": {
"editor.autoIndent": "advanced"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"files.associations": {
"[Jj]enkinsfile*": "groovy",
".env*": "properties"
}
}
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
# eslint-config-jwalker
Shareable ESLint config

Shareable ESLint config

## Install

```sh
npm i --save-dev eslint-config-jwalker
# flat config
npm i -D eslint-config-jwalker

# classic config
npm i -D eslint-config-jwalker@8
```

## Usage - Flat Config

```javascript
import tsParser from '@typescript-eslint/parser'
import dwEslintConfig from '@deepwaterv2/eslint-config'

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
...dwEslintConfig,
{ ignores: ['types/*', 'scripts/*', '**/*.d.ts'] },
{
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.eslint.json'],
},
},
},
]
```


Expand All @@ -20,11 +47,11 @@ Add this to your `.eslintrc` file (or `package.json`):

```json
{
"extends": "jwalker"
"extends": "jwalker"
}
```

*Note: We omitted the `eslint-config-` prefix since it is automatically assumed by ESLint.*
_Note: We omitted the `eslint-config-` prefix since it is automatically assumed by ESLint._

You can override settings from the shareable config by adding them directly into your
`.eslintrc` file.
2 changes: 2 additions & 0 deletions conf/common.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: import("eslint").Linter.FlatConfig[];
export default _default;
Loading

0 comments on commit 99748f6

Please sign in to comment.