Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shuritch committed Jul 31, 2023
0 parents commit acaeb62
Show file tree
Hide file tree
Showing 26 changed files with 420 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
35 changes: 35 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Build
node_modules/
dist/
dist-ssr/
*.local
.env
build/
package/
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"./index.js",
"plugin:prettier/recommended"
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Build
node_modules/
dist/
dist-ssr/
*.local
.env
build/
package/
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
36 changes: 36 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Build
node_modules/
dist/
dist-ssr/
*.local
.env
build/
.svelte-kit/
package/
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
35 changes: 35 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Build
node_modules/
dist/
dist-ssr/
*.local
.env
build/
package/
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
20 changes: 20 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"endOfLine": "lf",
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": true,
"trailingComma": "all",
"semi": true,
"useTabs": false,
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"singleAttributePerLine": false,
"embeddedLanguageFormatting": "auto",
"pluginSearchDirs": ["."],
"quoteProps": "as-needed",
"proseWrap": "always",
"overrides": [
{ "files": ["**/*.json", "**/.*rc"], "options": { "parser": "json", "tabWidth": 2 } }
]
}
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Alexander Ivanov <sashapop101@gmail.com>
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## [Unreleased][unreleased]
## [1.0.0][] - 2023-07-31

- Stable version

[unreleased]: https://github.com/sashapop10/eslint-config-sashapop10/compare/release...HEAD
[1.0.0]: https://github.com/sashapop10/eslint-config-sashapop10/releases/tag/release
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Contributing

## Bug report / Feature request

For bug reports please describe the bug with a clear and concise description,
steps to reproduce the behavior (usage example or test), expected behavior,
provide OS and Node.js version, you can upload screenshots and any additional
context for better understanding.

Please don't open an issue to ask questions. Ask it in discussions.

## Pull Requests

Preparing pull requests steps:

- [ ] Code is properly formatted (`npm run prettier:fix`)
- [ ] Tests are added/updated for bug fixes and new features
- [ ] Tests and linter show no problems (`npm t`)
- [ ] Typings .d.ts added/updated
- [ ] Description of changes is added in CHANGELOG.md
8 changes: 8 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The MIT License (MIT)
Copyright © 2023 sashapop10

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<h1 align="center">My ESlint config</h1>

**1**. Install required packages: <br/>

```bash
npm i -D eslint prettier eslint-plugin-import eslint-config-sashapop10 eslint-config-prettier eslint-plugin-prettier
```

**2**. Add `"extends": ["sashapop10"]` to your `.eslintrc`.

**3**. _(optional)_ Add following scripts

```json
// package.json
{
"scripts": {
"lint": "eslint . && prettier --check \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"",
"fmt": "prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"",
"test": "npm run -s lint"
//...
}
//...
}
```

<h2 align="center">Copyright & contributors</h2>

<p align="center">
Copyright © 2023 <a href="https://github.com/LeadFisherSolutions/eslint-config-leadfisher/graphs/contributors">sashapop10</a>.
eslint-config-sashapop10 is <a href="./LICENSE">MIT licensed license</a>.<br/>
</p>
9 changes: 9 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security Policy

## Reporting Vulnerability

Let us know if you have found a vulnerability.
Send email to [sashapop101@gmail.com](mailto:sashapop101@gmail.com).
We will investigate and quickly fix the problem.
Please don't discuss this security vulnerability in a public.
Thanks for understanding !
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

const rules = [
'possible-errors',
'best-practices',
'strict-mode',
'variables',
'nodejs-and-commonjs',
'stylistic-issues',
'ecmascript-6',
'plugin-import',
'parser-options',
'ecmascript-13',
].map(rule => require.resolve('./rules/' + rule));

module.exports = { extends: ['eslint:recommended', ...rules] };
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"license": "MIT",
"version": "0.0.1",
"type": "commonjs",
"name": "eslint-config-sashapop10",
"homepage": "https://github.com/sashapop10/eslint-config-sashapop10",
"description": "My ESlint config",
"author": "Alexander Ivanov <sashapop101@gmail.com>",
"keywords": ["eslint", "eslint-config", "lint", "linter", "config", "preset", "eslint-rules"],

"main": "index.js",
"packageManager": "npm@9.6.4",
"readmeFilename": "README.md",
"engines": { "node": "18 || 19 || 20" },
"files": ["rules/"],
"repository": { "type": "git", "url": "git+https://github.com/sashapop10/eslint-config-sashapop10.git" },

"bugs": {
"url": "https://github.com/sashapop10/eslint-config-sashapop10/issues",
"email": "sashapop101@gmail.com"
},

"devDependencies": {
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8"
},

"peerDependencies": {
"eslint": "^8.45.0",
"eslint-plugin-import": "^2.27.5"
}
}
14 changes: 14 additions & 0 deletions rules/best-practices.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

module.exports = {
rules: {
eqeqeq: ['error', 'always'],
'no-loop-func': ['error'],
'no-self-compare': ['error'],
'no-unmodified-loop-condition': ['error'],
'no-useless-concat': ['error'],
curly: ['error', 'multi-line', 'consistent'],
'consistent-return': ['error', { treatUndefinedAsUnspecified: true }],
'no-return-await': ['error'],
},
};
9 changes: 9 additions & 0 deletions rules/ecmascript-13.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = {
rules: {
'no-unused-private-class-members': ['error'],
'no-invalid-this': ['error'],
'class-methods-use-this': ['warn'],
},
};
21 changes: 21 additions & 0 deletions rules/ecmascript-6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

module.exports = {
env: { es6: true },
rules: {
'arrow-body-style': ['error', 'as-needed'],
'arrow-parens': ['error', 'always'],
'arrow-spacing': ['error'],
'no-useless-computed-key': ['error'],
'no-useless-rename': ['error'],
'no-var': ['error'],
'object-shorthand': ['error', 'always'],
'prefer-arrow-callback': ['error'],
'prefer-const': ['error'],
'prefer-numeric-literals': ['error'],
'prefer-rest-params': ['error'],
'prefer-spread': ['error'],
'rest-spread-spacing': ['error', 'never'],
'template-curly-spacing': ['error', 'never'],
},
};
3 changes: 3 additions & 0 deletions rules/nodejs-and-commonjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = { env: { node: true }, rules: { 'handle-callback-err': ['error', '^err'] } };
3 changes: 3 additions & 0 deletions rules/parser-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = { parserOptions: { ecmaVersion: 'latest' } };
6 changes: 6 additions & 0 deletions rules/plugin-import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = {
plugins: ['import'],
rules: { 'import/no-unresolved': [ 'error', { commonjs: true, } ] },
};
9 changes: 9 additions & 0 deletions rules/possible-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = {
rules: {
'no-console': ['off'],
'no-constant-condition': [ 'error', { checkLoops: false } ],
'no-return-assign': ['error'],
},
};
3 changes: 3 additions & 0 deletions rules/strict-mode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = { rules: { strict: ['error', 'global'] } };
Loading

0 comments on commit acaeb62

Please sign in to comment.