Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
firefoxic committed May 6, 2024
0 parents commit 738a544
Show file tree
Hide file tree
Showing 13 changed files with 1,357 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- '*'

env:
FORCE_COLOR: true

jobs:
test:
name: Test

runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'

- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.local/share/pnpm/store/v3
key: cache-pnpm-${{ hashFiles('./pnpm-lock.yaml') }}
restore-keys: cache-pnpm-

- name: Install dependencies
run: corepack enable pnpm && pnpm i

- name: Run tests
run: pnpm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
*.log
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
git stash -ku

trap "git stash pop" EXIT

pnpm test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- markdownlint-disable MD024 -->
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Base config for `eslint` without using `globals`, but with its re-export.

[Unreleased]: https://github.com/firefoxic/codeguide/compare/v0.0.1...HEAD
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MIT License

Copyright © Sergey Artemov <firefoxic.dev@gmail.com>, 2024

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.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# @firefoxic/eslint-config

[![Test Status][test-image]][test-url]
[![License: MIT][license-image]][license-url]
[![NPM version][npm-image]][npm-url]

Shared config for eslint by [firefoxic](https://firefoxic.dev).

To see the rules that this config uses, please read the [config itself](./lib/index.js).

## Installation

```shell
pnpm add eslint @firefoxic/eslint-config -D
```

## Usage

Set your `eslint.config.js` to:

```js
import { default as firefoxicEslintConfigJs, globals } from "@firefoxic/eslint-config"

export default [
{
languageOptions: {
globals: {
...globals.browser, // If you're working on a frontend project
...globals.nodeBuiltin, // If you're working on a Node.js project
},
},
},
...firefoxicEslintConfigJs,
{
rules: {
// Your overrides or additions to rules
}
}
]
```

## Useful links

- [Changelog](./CHANGELOG.md)

[test-url]: https://github.com/firefoxic/eslint-config/actions
[test-image]: https://github.com/firefoxic/eslint-config/actions/workflows/test.yml/badge.svg?branch=main

[npm-url]: https://npmjs.org/package/firefoxic/eslint-config
[npm-image]: https://badge.fury.io/js/@firefoxic%2Feslint-config.svg

[license-url]: https://github.com/firefoxic/eslint-config/eslint-config/blob/main/LICENSE.md
[license-image]: https://img.shields.io/badge/License-MIT-limegreen.svg
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { default as firefoxicEslintConfigJs, globals } from "./lib/index.js"

export default [
{
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
},
...firefoxicEslintConfigJs,
]
Loading

0 comments on commit 738a544

Please sign in to comment.