-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julian Schleemann
committed
Mar 9, 2023
0 parents
commit b2838c2
Showing
15 changed files
with
2,006 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Publish to NPM | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
cache: yarn | ||
- run: yarn install | ||
- run: yarn publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# dependencies | ||
node_modules/ | ||
|
||
# editor | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
"singleQuote": true | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 ATMINA Solutions GmbH | ||
|
||
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. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const eslintJs = require('@eslint/js'); | ||
const importPlugin = require('eslint-plugin-import'); | ||
const globals = require('globals'); | ||
|
||
const ignores = [ | ||
'**/node_modules', | ||
'**/build', | ||
'**/dist', | ||
'**/.cache', | ||
'**/.storybook', | ||
'**/.next', | ||
]; | ||
|
||
/** | ||
* @type {import('eslint').Linter.FlatConfig} | ||
*/ | ||
module.exports = { | ||
files: ['**/*.{ts,tsx,js,jsx}'], | ||
ignores, | ||
plugins: { import: importPlugin }, | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
}, | ||
}, | ||
rules: { | ||
...eslintJs.configs.recommended.rules, | ||
...importPlugin.configs.recommended.rules, | ||
'import/order': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
'builtin', | ||
'external', | ||
'internal', | ||
'parent', | ||
'sibling', | ||
'index', | ||
'object', | ||
], | ||
alphabetize: { order: 'asc', caseInsensitive: true }, | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { FlatCompat } = require('@eslint/eslintrc'); | ||
|
||
const compat = new FlatCompat({ baseDirectory: __dirname }); | ||
|
||
/** | ||
* @type {import('eslint').Linter.FlatConfig} | ||
*/ | ||
module.exports = { | ||
...compat.extends('next'), | ||
rules: { | ||
// /app: The root layout actually does need a <head> element. | ||
'@next/next/no-head-element': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Runs Prettier as an ESLint rule and reports differences as individual ESLint issues. | ||
const prettierPlugin = require('eslint-plugin-prettier'); | ||
|
||
// Turns off all rules that are unnecessary or might conflict with Prettier. | ||
const prettierOverrides = require('eslint-config-prettier'); | ||
|
||
const prettierOptions = require('../prettier'); | ||
|
||
const ignores = [ | ||
'**/node_modules', | ||
'**/build', | ||
'**/dist', | ||
'**/.cache', | ||
'**/.storybook', | ||
'**/.next', | ||
]; | ||
|
||
/** | ||
* @type {import('eslint').Linter.FlatConfig} | ||
*/ | ||
module.exports = { | ||
files: ['**/*.{ts,tsx,js,jsx}'], | ||
ignores, | ||
plugins: { prettier: prettierPlugin }, | ||
rules: { | ||
...prettierOverrides.rules, | ||
...prettierPlugin.configs.recommended.rules, | ||
// Note: this effectively locks in our Prettier configuration (ignoring | ||
// .prettierrc completely). Since this is an opinionated setup, we probably | ||
// don't want to allow customization anyway. | ||
'prettier/prettier': ['error', prettierOptions], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @type {import('eslint').Linter.FlatConfig[]} | ||
*/ | ||
module.exports = [ | ||
require('./base'), | ||
require('./typescript'), | ||
require('./prettier'), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { FlatCompat } = require('@eslint/eslintrc'); | ||
|
||
const compat = new FlatCompat({ baseDirectory: __dirname }); | ||
|
||
/** | ||
* @type {import('eslint').Linter.FlatConfig} | ||
*/ | ||
module.exports = compat.extends('plugin:tailwindcss/recommended'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const importPlugin = require('eslint-plugin-import'); | ||
const typescriptEslintPlugin = require('@typescript-eslint/eslint-plugin'); | ||
const typescriptEslintParser = require('@typescript-eslint/parser'); | ||
|
||
const ignores = [ | ||
'**/node_modules', | ||
'**/build', | ||
'**/dist', | ||
'**/.cache', | ||
'**/.storybook', | ||
'**/.next', | ||
]; | ||
|
||
/** | ||
* @type {import('eslint').Linter.FlatConfig} | ||
*/ | ||
module.exports = { | ||
files: ['**/*.{ts,tsx}'], | ||
ignores, | ||
plugins: { '@typescript-eslint': typescriptEslintPlugin }, | ||
languageOptions: { | ||
parser: typescriptEslintParser, | ||
parserOptions: { | ||
sourceType: 'module', | ||
project: ['./tsconfig.json'], | ||
}, | ||
}, | ||
settings: { | ||
...importPlugin.configs.typescript.settings, | ||
}, | ||
rules: { | ||
...typescriptEslintPlugin.configs['eslint-recommended'].overrides[0].rules, | ||
...typescriptEslintPlugin.configs.recommended.rules, | ||
...importPlugin.configs.typescript.rules, | ||
'@typescript-eslint/consistent-type-exports': 'warn', | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'warn', | ||
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }, | ||
], | ||
'@typescript-eslint/ban-ts-comment': [ | ||
'error', | ||
{ | ||
'ts-expect-error': 'allow-with-description', | ||
'ts-ignore': 'allow-with-description', | ||
minimumDescriptionLength: 10, | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
throw new Error('Please import the configs directly from the corresponding sub-module.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@atmina/linting", | ||
"version": "0.0.1", | ||
"description": "A collection of opinionated in-house linting rules.", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"keywords": [ | ||
"eslint", | ||
"prettier", | ||
"typescript" | ||
], | ||
"files": ["index.js", "/eslint", "/prettier"], | ||
"author": "ATMINA Solutions GmbH <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/eslint": "^8.21.1", | ||
"@types/node": "^18.14.6", | ||
"@types/prettier": "^2.7.2", | ||
"@typescript-eslint/parser": "^5.54.1", | ||
"tailwindcss": "^3.2.7", | ||
"typescript": "^4.9.5" | ||
}, | ||
"dependencies": { | ||
"@eslint/eslintrc": "^2.0.0", | ||
"@eslint/js": "^8.35.0", | ||
"@typescript-eslint/eslint-plugin": "^5.54.1", | ||
"eslint": "^8.35.0", | ||
"eslint-config-prettier": "^8.7.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-tailwindcss": "^3.10.1", | ||
"globals": "^13.20.0", | ||
"prettier": "^2.8.4" | ||
} | ||
} |
Oops, something went wrong.