Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tooling): Updating eslint and commitlint config. #435

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
node_modules/*
docs/*
dist/*
docs-src/*
rollup.config.js
custom-elements.json
component-list.json
resolved-outline-config.ts
resolved-tailwind-config.ts
# Directories
.changeset/
.history/
storybook-static/
*.js
*.lit.ts
.husky/
.github/
.octane-ci/
.bin/
.docksal/
.turbo/
.vscode/
.yarn/
project/
*.d.ts
packages/deprecated
docs/
dist/
build/
node_modules/
storybook-static/

# File Patterns
scripts/*.js
packages/tools/outline-config/*
# This handles .js configurations in the root dir.
*.js

himerus marked this conversation as resolved.
Show resolved Hide resolved
# Specific Files

# Other
46 changes: 16 additions & 30 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,41 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"project": "./tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "lit"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:lit/recommended"
],
"env": {
"browser": true
},
"globals": {
"process": "readonly"
"browser": true,
"es2021": true
},
"rules": {
"no-prototype-builtins": "off",
"no-nested-ternary": 2,
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"lit-plugin/no-invalid-css": "off"
"@typescript-eslint/no-explicit-any": "error",
"lit/no-invalid-html": "error"
},
"overrides": [
{
"files": ["rollup.config.js", "web-test-runner.config.js"],
"env": {
"node": true
"files": ["*.ts"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
}
},
{
"files": [
"*_test.ts",
"**/custom_typings/*.ts",
"packages/lit-ssr/src/test/integration/tests/**",
"packages/lit-ssr/src/lib/util/parse5-utils.ts"
],
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-var-requires": "off"
}
}
]
Expand Down
27 changes: 27 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/**
* This configuration file for commitlint extends the default configuration
* provided by '@phase2/outline-config/commitlint.config'.
*
* The process of extending the configuration works in two steps:
*
* 1. Creating a Baseline Default:
* The default configuration is a set of rules defined in
* '@phase2/outline-config/commitlint.config'. These rules provide a
* baseline standard for commit messages, ensuring consistency and
* readability across all commits.
*
* 2. Allowing Project-Specific Alterations:
* By extending the default configuration in this file, we allow for
* project-specific alterations. This means that while the baseline rules
* are followed, there is flexibility for the project to define its own
* rules or override the default ones. This is done by adding or modifying
* rules in this file.
*
* If a project decides it doesn't need the default configuration, it can
* completely overwrite it by not extending '@phase2/outline-config/commitlint.config'
* and defining its own rules from scratch.
*
* The use of the spread operator (...) before 'defaultConfig' ensures that
* the rules from the default configuration are correctly imported and
* applied in this file.
*/
const defaultConfig = require(`@phase2/outline-config/commitlint.config`);
module.exports = {
...defaultConfig,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"homepage": "https://github.com/phase2/outline#readme",
"_id": "@phase2/[email protected]",
"dependencies": {
"eslint-plugin-lit": "^1.11.0",
"lit": "^3.1.2"
}
}
18 changes: 17 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5488,6 +5488,15 @@ eslint-plugin-import@^2.22.1:
semver "^6.3.1"
tsconfig-paths "^3.15.0"

eslint-plugin-lit@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-lit/-/eslint-plugin-lit-1.11.0.tgz#32fc1c58b476e5b9aa1c7b6ba9de295641bd4e9b"
integrity sha512-jVqy2juQTAtOzj1ILf+ZW5GpDobXlSw0kvpP2zu2r8ZbW7KISt7ikj1Gw9DhNeirEU1UlSJR0VIWpdr4lzjayw==
dependencies:
parse5 "^6.0.1"
parse5-htmlparser2-tree-adapter "^6.0.1"
requireindex "^1.2.0"

eslint-plugin-react@^7.23.0:
version "7.33.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz#69ee09443ffc583927eafe86ffebb470ee737608"
Expand Down Expand Up @@ -8630,6 +8639,13 @@ parse-json@^5.0.0, parse-json@^5.2.0:
json-parse-even-better-errors "^2.3.0"
lines-and-columns "^1.1.6"

parse5-htmlparser2-tree-adapter@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6"
integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==
dependencies:
parse5 "^6.0.1"

[email protected]:
version "5.1.0"
resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2"
Expand Down Expand Up @@ -9618,7 +9634,7 @@ require-main-filename@^2.0.0:
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==

requireindex@^1.1.0:
requireindex@^1.1.0, requireindex@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef"
integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==
Expand Down
Loading