Skip to content

Commit

Permalink
Create an initial version 0.0.1-alpha.1
Browse files Browse the repository at this point in the history
No idea if it'll work in a project, let's publish and test.
  • Loading branch information
jstasiak committed Oct 16, 2023
0 parents commit 6c9d111
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: yarn install
- run: yarn exec -- ./lint.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 100,
"semi": false,
"tabWidth": 4
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The Lune Climate shared ESLint configuration
3 changes: 3 additions & 0 deletions fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
prettier --write *.js
42 changes: 42 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: ['standard', 'prettier', 'eslint:recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',

// These are needed for some of the typescript-eslint type-based linting rules
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint', 'simple-import-sort'],
rules: {
// Unnecessary with TS and generates false positives.
// https://github.com/typescript-eslint/typescript-eslint/blob/181e705887e9e07f0fa28195644cc94e5b4f039d/docs/linting/Troubleshooting.mdx#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off',
'no-use-before-define': 'off', // Unnecessary with TS and generates false positives.
'comma-dangle': ['error', 'always-multiline'],
'func-style': ['error', 'declaration'],
'no-useless-constructor': 'off',
'no-unused-vars': 'off',
'no-extra-semi': 'off',
'no-trailing-spaces': 'error',
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-unnecessary-condition': ['error'],
'simple-import-sort/imports': ['error'],
complexity: ['error', { max: 14 }],
// To support TS overloads
// https://github.com/typescript-eslint/typescript-eslint/blob/6fd476c32c4757cb9f4c442f0cd92875671eed30/packages/eslint-plugin/docs/rules/no-redeclare.md
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': ['error'],
},
}
3 changes: 3 additions & 0 deletions lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
prettier --check *.js
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@lune-climate/eslint-config",
"private": false,
"version": "0.0.1-alpha.1",
"description": "The Lune Climate shared ESLint configuration",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/lune-climate/shared-configs.git"
},
"keywords": [
"eslint",
"eslintconfig",
"luneclimate",
"lune"
],
"author": "Lune Climate <eng@lune.co>",
"license": "MIT",
"bugs": {
"url": "https://github.com/lune-climate/shared-configs/issues"
},
"homepage": "https://github.com/lune-climate/shared-configs#readme",
"devDependencies": {
"prettier": "^3.0.3"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.5",
"eslint": "^8.51.0",
"eslint-plugin-simple-import-sort": "^10.0.0"
},
"dependencies": {
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard": "^17.1.0"
}
}
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


eslint-config-prettier@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f"
integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==

eslint-config-standard@^17.1.0:
version "17.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz#40ffb8595d47a6b242e07cbfd49dc211ed128975"
integrity sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==

prettier@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==

0 comments on commit 6c9d111

Please sign in to comment.