Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
roikoren755 committed Nov 9, 2021
0 parents commit e2c4782
Show file tree
Hide file tree
Showing 498 changed files with 20,163 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "roikoren755/eslint-plugin-es" }
],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/fixtures
coverage/
239 changes: 239 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
const ERROR = 2;
const WARN = 1;
const OFF = 0;

module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
ecmaVersion: 6,
jsxPragma: null,
},
reportUnusedDisableDirectives: true,
plugins: ['import'],
settings: {
'import/parsers': { '@typescript-eslint/parser': ['.ts'] },
'import/resolver': { node: { extensions: ['.ts', '.js', '.json'] }, typescript: {} },
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/errors',
'plugin:unicorn/recommended',
'plugin:prettier/recommended',
'plugin:eslint-plugin/all',
],
rules: {
'array-callback-return': ERROR,
'arrow-body-style': ERROR,
'consistent-return': [WARN, { treatUndefinedAsUnspecified: true }],
curly: ERROR,
'default-case': ERROR,
eqeqeq: ERROR,
'guard-for-in': WARN,
'lines-between-class-members': ERROR,
'max-lines': ERROR,
'no-bitwise': ERROR,
'no-caller': ERROR,
'no-case-declarations': OFF,
'no-console': WARN,
'no-constructor-return': ERROR,
'no-continue': WARN,
'no-else-return': ERROR,
'no-eval': ERROR,
'no-extend-native': ERROR,
'no-extra-bind': ERROR,
'no-floating-decimal': ERROR,
'no-implicit-coercion': [ERROR, { allow: ['!!'] }],
'no-invalid-this': WARN,
'no-iterator': ERROR,
'no-lone-blocks': ERROR,
'no-lonely-if': ERROR,
'no-loop-func': ERROR,
'no-multi-assign': ERROR,
'no-nested-ternary': ERROR,
'no-new': ERROR,
'no-new-func': ERROR,
'no-new-wrappers': ERROR,
'no-param-reassign': ERROR,
'no-path-concat': ERROR,
'no-plusplus': [ERROR, { allowForLoopAfterthoughts: true }],
'no-process-exit': OFF,
'no-proto': ERROR,
'no-return-assign': ERROR,
'no-script-url': ERROR,
'no-self-compare': ERROR,
'no-shadow': ERROR,
'no-template-curly-in-string': ERROR,
'no-undef-init': ERROR,
'no-underscore-dangle': [WARN, { allowAfterThis: true, allowAfterSuper: true }],
'no-unmodified-loop-condition': ERROR,
'no-unneeded-ternary': [ERROR, { defaultAssignment: false }],
'no-useless-call': ERROR,
'no-useless-computed-key': ERROR,
'no-useless-concat': ERROR,
'no-useless-return': ERROR,
'no-void': ERROR,
'object-shorthand': ERROR,
'one-var': [ERROR, 'never'],
'operator-assignment': ERROR,
'padding-line-between-statements': [
ERROR,
// Always require blank lines after directive (like 'use-strict'), except between directives
{ blankLine: 'always', prev: 'directive', next: '*' },
{ blankLine: 'any', prev: 'directive', next: 'directive' },
// Always require blank lines after import, except between imports
{ blankLine: 'always', prev: 'import', next: '*' },
{ blankLine: 'any', prev: 'import', next: 'import' },
// Always require blank lines before and after every sequence of variable declarations and export
{ blankLine: 'always', prev: '*', next: ['const', 'let', 'var', 'export'] },
{ blankLine: 'always', prev: ['const', 'let', 'var', 'export'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var', 'export'], next: ['const', 'let', 'var', 'export'] },
// Always require blank lines before and after class declaration, if, do/while, switch, try
{ blankLine: 'always', prev: '*', next: ['if', 'class', 'for', 'do', 'while', 'switch', 'try'] },
{ blankLine: 'always', prev: ['if', 'class', 'for', 'do', 'while', 'switch', 'try'], next: '*' },
// Always require blank lines before return statements
{ blankLine: 'always', prev: '*', next: 'return' },
],
'prefer-destructuring': ERROR,
'prefer-exponentiation-operator': ERROR,
'prefer-numeric-literals': ERROR,
'prefer-promise-reject-errors': ERROR,
'prefer-regex-literals': ERROR,
'prefer-template': ERROR,
'quote-props': [ERROR, 'as-needed'],
radix: ERROR,
'spaced-comment': ERROR,
'sort-imports': [ERROR, { ignoreDeclarationSort: true }],
strict: ERROR,
yoda: ERROR,

'@typescript-eslint/array-type': ERROR,
'@typescript-eslint/ban-ts-comment': [ERROR, { 'ts-expect-error': false }],
'@typescript-eslint/ban-ts-ignore': OFF,
'@typescript-eslint/ban-types': WARN,
'@typescript-eslint/camelcase': OFF,
'@typescript-eslint/consistent-indexed-object-style': ERROR,
'@typescript-eslint/consistent-type-definitions': ERROR,
'@typescript-eslint/consistent-type-imports': ERROR,
'@typescript-eslint/class-literal-property-style': ERROR,
'@typescript-eslint/default-param-last': ERROR,
'@typescript-eslint/explicit-function-return-type': [ERROR, { allowExpressions: true }],
'@typescript-eslint/explicit-member-accessibility': [ERROR, { accessibility: 'no-public' }],
'@typescript-eslint/explicit-module-boundary-types': WARN,
'@typescript-eslint/interface-name-prefix': OFF,
'@typescript-eslint/method-signature-style': [ERROR, 'method'],
'@typescript-eslint/no-empty-function': WARN,
'@typescript-eslint/no-empty-interface': [WARN, { allowSingleExtends: true }],
'@typescript-eslint/no-extra-non-null-assertion': ERROR,
'@typescript-eslint/no-extraneous-class': ERROR,
'@typescript-eslint/no-invalid-void-type': ERROR,
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': ERROR,
'@typescript-eslint/no-non-null-asserted-optional-chain': ERROR,
'@typescript-eslint/no-parameter-properties': ERROR,
'@typescript-eslint/no-unused-expressions': [ERROR, { allowTernary: true }],
'@typescript-eslint/no-unused-vars': [ERROR, { ignoreRestSiblings: true }],
'@typescript-eslint/no-use-before-define': WARN,
'@typescript-eslint/no-useless-constructor': ERROR,
'@typescript-eslint/no-var-requires': WARN,
'@typescript-eslint/prefer-as-const': ERROR,
'@typescript-eslint/prefer-for-of': ERROR,
'@typescript-eslint/prefer-function-type': ERROR,
'@typescript-eslint/prefer-optional-chain': WARN,
'@typescript-eslint/prefer-ts-expect-error': ERROR,
'@typescript-eslint/sort-type-union-intersection-members': ERROR,
'@typescript-eslint/unified-signatures': ERROR,

'@typescript-eslint/consistent-type-exports': ERROR,
'@typescript-eslint/dot-notation': ERROR,
'@typescript-eslint/naming-convention': [
ERROR,
{
selector: 'property',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allow',
filter: { regex: '^process\\.env\\.[A-Z][A-Z_]*$', match: false },
},
{ selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'], leadingUnderscore: 'allow' },
{ selector: 'typeLike', format: ['PascalCase'] },
{ selector: 'typeAlias', format: ['PascalCase'], custom: { regex: '^I[A-Z]', match: false } },
{ selector: 'interface', format: ['PascalCase'], prefix: ['I'] },
],
'@typescript-eslint/no-base-to-string': ERROR,
'@typescript-eslint/no-confusing-void-expression': ERROR,
'@typescript-eslint/no-floating-promises': WARN,
'@typescript-eslint/no-implied-eval': ERROR,
'@typescript-eslint/no-meaningless-void-operator': [ERROR, { checkNever: false }],
'@typescript-eslint/no-throw-literal': ERROR,
'@typescript-eslint/no-unnecessary-boolean-literal-compare': ERROR,
'@typescript-eslint/no-unnecessary-type-arguments': ERROR,
'@typescript-eslint/no-unsafe-argument': WARN,
'@typescript-eslint/no-unsafe-assignment': WARN,
'@typescript-eslint/no-unsafe-call': WARN,
'@typescript-eslint/no-unsafe-member-access': WARN,
'@typescript-eslint/no-unsafe-return': WARN,
'@typescript-eslint/prefer-nullish-coalescing': WARN,
'@typescript-eslint/prefer-readonly': ERROR,
'@typescript-eslint/prefer-reduce-type-parameter': ERROR,
'@typescript-eslint/prefer-regexp-exec': WARN,
'@typescript-eslint/prefer-return-this-type': ERROR,
'@typescript-eslint/require-array-sort-compare': ERROR,
'@typescript-eslint/require-await': ERROR,
'@typescript-eslint/restrict-template-expressions': WARN,
'@typescript-eslint/return-await': [ERROR, 'in-try-catch'],
'@typescript-eslint/switch-exhaustiveness-check': ERROR,
'@typescript-eslint/unbound-method': WARN,

'eslint-plugin/require-meta-docs-url': OFF,

'import/extensions': [ERROR, { json: 'always' }],
'import/first': ERROR,
'import/named': OFF,
'import/namespace': OFF,
'import/newline-after-import': ERROR,
'import/no-cycle': WARN,
'import/no-default-export': ERROR,
'import/no-extraneous-dependencies': ERROR,
'import/no-unresolved': WARN,
'import/no-useless-path-segments': ERROR,
'import/order': [OFF, { groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'] }],

'unicorn/better-regex': WARN,
'unicorn/catch-error-name': OFF,
'unicorn/consistent-function-scoping': OFF,
'unicorn/explicit-length-check': WARN,
'unicorn/filename-case': WARN,
'unicorn/import-index': WARN,
'unicorn/import-style': WARN,
'unicorn/no-array-for-each': OFF,
'unicorn/no-array-reduce': OFF,
'unicorn/no-array-callback-reference': WARN,
'unicorn/no-null': OFF,
'unicorn/no-object-as-default-parameter': WARN,
'unicorn/no-process-exit': OFF,
'unicorn/no-unreadable-array-destructuring': OFF,
'unicorn/no-useless-undefined': OFF,
'unicorn/prefer-add-event-listener': WARN,
'unicorn/prefer-array-flat': OFF,
'unicorn/prefer-module': OFF,
'unicorn/prefer-negative-index': WARN,
'unicorn/prefer-node-protocol': OFF,
'unicorn/prefer-number-properties': OFF,
'unicorn/prefer-object-from-entries': OFF,
'unicorn/prefer-optional-catch-binding': WARN,
'unicorn/prefer-query-selector': WARN,
'unicorn/prefer-set-has': WARN,
'unicorn/prefer-spread': OFF,
'unicorn/prefer-string-slice': WARN,
'unicorn/prefer-ternary': WARN,
'unicorn/prevent-abbreviations': OFF,
'unicorn/template-indent': [WARN, { tags: ['bq', 'gql', 'html', 'pg', 'query', 'sql', 'styled'] }],
},
overrides: [
{ files: ['./.commitlintrc.js', './.eslintrc.js', './.prettierrc.js'], rules: { 'no-undef': OFF } },
{ files: ['./src/index.ts', './src/configs/*.ts', './src/rules/*.ts'], rules: { 'import/no-default-export': OFF } },
{ files: ['./scripts/*.ts', './tests/**/*.ts'], rules: { 'no-console': OFF } },
{ files: ['./src/index.ts'], rules: { 'max-lines': OFF } },
],
};
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- Version [e.g. 0.0.1]
- Component [e.g. `es-roikoren/no-arrow-functions`]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request.
Before submitting a pull request, please make sure the following is done:
1. A relevant issue exists and is open. If not, please open an issue first.
2. Fork [the repository](https://github.com/roikoren755/eslint-plugin-es) and create your branch from `main`.
3. Run `yarn` in the repository root.
4. If you've fixed a bug or added code that should be tested, add tests!
5. Make sure your code lints (`yarn lint`).
6. Run the TypeScript type checks (`yarn type`).
7. Use `conventional-commits` guidelines for commit messages and PR title. The developer tooling and status checks will help you here if you are unsure.
-->

## Summary

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

## Issues

<!-- Link to the issue(s?) this PR solves, with Fixes #ISSUE_NUMBER -->
35 changes: 35 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '16 5 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript']

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Loading

0 comments on commit e2c4782

Please sign in to comment.