Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dworak-dev committed Mar 1, 2023
0 parents commit d9a0e3f
Show file tree
Hide file tree
Showing 14 changed files with 2,018 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/settings.yml @dworac
84 changes: 84 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/

repository:
# See https://docs.github.com/en/rest/reference/repos#update-a-repository for all available settings.

# The name of the repository. Changing this will rename the repository
name: eslint-config-typescript

# A short description of the repository that will show up on GitHub
description: dworac's eslint typescript configuration with airbnb, prettier and jsdoc.

# Either 'true' or 'false' to make it a template.
is_template: false

# A URL with more information about the repository
homepage: https://github.com/dworac/eslint-config-typescript

# A comma-separated list of topics to set on the repository
topics: node,typescript,template,jest,eslint,prettier,esbuild

# Either `true` to make the repository private, or `false` to make it public.
private: false

# Either `true` to enable issues for this repository, `false` to disable them.
has_issues: true

# Either `true` to enable projects for this repository, or `false` to disable them.
# If projects are disabled for the organization, passing `true` will cause an API error.
has_projects: false

# Either `true` to enable the wiki for this repository, `false` to disable it.
has_wiki: false

# Either `true` to enable downloads for this repository, `false` to disable them.
has_downloads: true

# Updates the default branch for this repository.
default_branch: master

# Either `true` to allow squash-merging pull requests, or `false` to prevent
# squash-merging.
allow_squash_merge: false

# Either `true` to allow merging pull requests with a merge commit, or `false`
# to prevent merging pull requests with merge commits.
allow_merge_commit: true

# Either `true` to allow rebase-merging pull requests, or `false` to prevent
# rebase-merging.
allow_rebase_merge: true

# Either `true` to enable automatic deletion of branches on merge, or `false` to disable
delete_branch_on_merge: true

# Either `true` to enable automated security fixes, or `false` to disable
# automated security fixes.
enable_automated_security_fixes: true

# Either `true` to enable vulnerability alerts, or `false` to disable
# vulnerability alerts.
enable_vulnerability_alerts: true

branches:
- name: master
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 0
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: false
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: true
# Required. Require status checks to pass before merging. Set to null to disable
required_status_checks: null
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins: true
# Prevent merge commits from being pushed to matching branches
required_linear_history: false
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
restrictions: null

18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish package to NPM
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Please
permissions:
contents: write
pull-requests: write
on:
push:
branches:
- master
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: release-please-action
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/eslint-config-typescript.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# dworac ESLint Typescript Configuration

ESLint is a popular tool that helps maintain consistent code quality across a project. The template you provided comes with a pre-configured ESLint setup that has support for TypeScript, the AirBnB preset, Prettier, and JSDoc. Let's take a closer look at each of these components and the configuration for the template.

### TypeScript Support
The @typescript-eslint package provides linting rules specifically tailored for TypeScript. This is important because regular ESLint does not understand TypeScript syntax. The @typescript-eslint/parser package allows ESLint to parse TypeScript code, and the @typescript-eslint/eslint-plugin package provides TypeScript-specific linting rules.

```javascript
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
```

### AirBnB Preset
The AirBnB preset provides a comprehensive set of ESLint rules based on the AirBnB JavaScript style guide. These rules are designed to improve the readability, maintainability, and overall quality of your code. The airbnb-base preset provides the core AirBnB rules, while airbnb-typescript/base extends these rules with additional TypeScript-specific rules.

```javascript
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-base',
'airbnb-typescript/base',
],
```

### Prettier
Prettier is a code formatter that can automatically format your code to adhere to a consistent style. The eslint-config-prettier package disables any ESLint rules that conflict with Prettier, and the eslint-plugin-prettier package integrates Prettier into ESLint so that you can run Prettier automatically using an ESLint command.

```javascript
extends: [
// ...
'plugin:prettier/recommended',
],
rules: {
'prettier/prettier': ['error', { endOfLine: 'auto' }],
},
```

### JSDoc
JSDoc is a tool for documenting JavaScript code. The eslint-plugin-jsdoc package provides linting rules that enforce JSDoc comments in your code. This can help improve code readability and maintainability by making it easier for other developers to understand what your code does.

```javascript
extends: [
// ...
'plugin:jsdoc/recommended',
],
plugins: ['jsdoc'],
rules: {
'jsdoc/require-file-overview': 1,
},
settings: {
jsdoc: {
structuredTags: {
swagger: {
name: 'swagger',
},
openapi: {
name: 'swagger',
},
},
},
},
```
Loading

0 comments on commit d9a0e3f

Please sign in to comment.