[EC-183] Move eslint and prettier to project root (#2536)
This commit is contained in:
parent
06f72b90d7
commit
c1cc5a0814
|
@ -0,0 +1,9 @@
|
||||||
|
**/build
|
||||||
|
**/jslib
|
||||||
|
**/webpack.config.js
|
||||||
|
**/karma.conf.js
|
||||||
|
**/gulpfile.js
|
||||||
|
apps/browser/src/content/autofill.js
|
||||||
|
apps/browser/src/scripts/duo.js
|
||||||
|
|
||||||
|
**/node_modules
|
|
@ -0,0 +1,55 @@
|
||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"webextensions": true
|
||||||
|
},
|
||||||
|
"plugins": ["@typescript-eslint"],
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:import/recommended",
|
||||||
|
"plugin:import/typescript",
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"@typescript-eslint/no-explicit-any": "off", // TODO: This should be re-enabled
|
||||||
|
"@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }],
|
||||||
|
"@typescript-eslint/explicit-member-accessibility": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"accessibility": "no-public"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-this-alias": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"allowedNames": ["self"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-console": "warn",
|
||||||
|
"import/no-unresolved": "off", // TODO: Look into turning off once each package is an actual package.
|
||||||
|
"import/order": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"alphabetize": {
|
||||||
|
"order": "asc"
|
||||||
|
},
|
||||||
|
"newlines-between": "always",
|
||||||
|
"pathGroups": [
|
||||||
|
{
|
||||||
|
"pattern": "jslib-*/**",
|
||||||
|
"group": "external",
|
||||||
|
"position": "after"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pattern": "src/**/*",
|
||||||
|
"group": "parent",
|
||||||
|
"position": "before"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pathGroupsExcludedImportTypes": ["builtin"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ on:
|
||||||
- 'l10n_master'
|
- 'l10n_master'
|
||||||
- 'gh-pages'
|
- 'gh-pages'
|
||||||
paths:
|
paths:
|
||||||
- 'apps/browser'
|
- 'apps/browser/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs: {}
|
inputs: {}
|
||||||
|
|
||||||
|
@ -33,26 +33,6 @@ jobs:
|
||||||
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
||||||
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: Lint
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
|
|
||||||
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0
|
|
||||||
with:
|
|
||||||
cache: 'npm'
|
|
||||||
cache-dependency-path: '**/package-lock.json'
|
|
||||||
node-version: '16'
|
|
||||||
|
|
||||||
- name: Run linter
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
npm run lint
|
|
||||||
|
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
name: Setup
|
name: Setup
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
|
@ -7,7 +7,7 @@ on:
|
||||||
- 'l10n_master'
|
- 'l10n_master'
|
||||||
- 'gh-pages'
|
- 'gh-pages'
|
||||||
paths:
|
paths:
|
||||||
- 'apps/desktop'
|
- 'apps/desktop/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs: {}
|
inputs: {}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
name: Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- 'l10n_master'
|
||||||
|
- 'gh-pages'
|
||||||
|
paths-ignore:
|
||||||
|
- '.github/workflows/**'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs: {}
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0
|
||||||
|
with:
|
||||||
|
cache: 'npm'
|
||||||
|
cache-dependency-path: '**/package-lock.json'
|
||||||
|
node-version: '16'
|
||||||
|
|
||||||
|
- name: Run linter
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run lint
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules/
|
|
@ -0,0 +1 @@
|
||||||
|
_
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx lint-staged
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Build directories
|
||||||
|
**/build
|
||||||
|
**/dist
|
||||||
|
**/coverage
|
||||||
|
|
||||||
|
**/jslib
|
||||||
|
|
||||||
|
# External libraries / auto synced locales
|
||||||
|
apps/browser/src/_locales
|
||||||
|
apps/browser/src/scripts/duo.js
|
||||||
|
apps/browser/src/content/autofill.js
|
||||||
|
apps/browser/src/safari
|
||||||
|
|
||||||
|
# Github Workflows
|
||||||
|
.github/workflows
|
|
@ -1,9 +0,0 @@
|
||||||
**/build
|
|
||||||
jslib
|
|
||||||
webpack.config.js
|
|
||||||
karma.conf.js
|
|
||||||
gulpfile.js
|
|
||||||
src/content/autofill.js
|
|
||||||
src/scripts/duo.js
|
|
||||||
|
|
||||||
**/node_modules
|
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
"root": true,
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"webextensions": true
|
|
||||||
},
|
|
||||||
"extends": ["./jslib/shared/eslintrc.json"],
|
|
||||||
"rules": {
|
|
||||||
"import/order": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"alphabetize": {
|
|
||||||
"order": "asc"
|
|
||||||
},
|
|
||||||
"newlines-between": "always",
|
|
||||||
"pathGroups": [
|
|
||||||
{
|
|
||||||
"pattern": "jslib-*/**",
|
|
||||||
"group": "external",
|
|
||||||
"position": "after"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pattern": "src/**/*",
|
|
||||||
"group": "parent",
|
|
||||||
"position": "before"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"pathGroupsExcludedImportTypes": ["builtin"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
# Build directories
|
|
||||||
build
|
|
||||||
dist
|
|
||||||
coverage
|
|
||||||
|
|
||||||
jslib
|
|
||||||
|
|
||||||
# External libraries / auto synced locales
|
|
||||||
src/_locales
|
|
||||||
src/scripts/duo.js
|
|
||||||
src/content/autofill.js
|
|
||||||
src/safari
|
|
||||||
|
|
||||||
# Github Workflows
|
|
||||||
.github/workflows
|
|
|
@ -1,4 +1,4 @@
|
||||||
[![Github Workflow build on master](https://github.com/bitwarden/browser/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/bitwarden/browser/actions/workflows/build.yml?query=branch:master)
|
[![Github Workflow build browser on master](https://github.com/bitwarden/bitwarden/actions/workflows/build-browser.yml/badge.svg?branch=master)](https://github.com/bitwarden/bitwarden/actions/workflows/build-browser.yml?query=branch:master)
|
||||||
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/bitwarden-browser/localized.svg)](https://crowdin.com/project/bitwarden-browser)
|
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/bitwarden-browser/localized.svg)](https://crowdin.com/project/bitwarden-browser)
|
||||||
[![Join the chat at https://gitter.im/bitwarden/Lobby](https://badges.gitter.im/bitwarden/Lobby.svg)](https://gitter.im/bitwarden/Lobby)
|
[![Join the chat at https://gitter.im/bitwarden/Lobby](https://badges.gitter.im/bitwarden/Lobby.svg)](https://gitter.im/bitwarden/Lobby)
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,11 +21,8 @@
|
||||||
"dist:safari:mas": "npm run build:prod && gulp dist:safari:mas",
|
"dist:safari:mas": "npm run build:prod && gulp dist:safari:mas",
|
||||||
"dist:safari:masdev": "npm run build:prod && gulp dist:safari:masdev",
|
"dist:safari:masdev": "npm run build:prod && gulp dist:safari:masdev",
|
||||||
"dist:safari:dmg": "npm run build:prod && gulp dist:safari:dmg",
|
"dist:safari:dmg": "npm run build:prod && gulp dist:safari:dmg",
|
||||||
"lint": "eslint . && prettier --check .",
|
|
||||||
"lint:fix": "eslint . --fix",
|
|
||||||
"test": "karma start --single-run",
|
"test": "karma start --single-run",
|
||||||
"test:watch": "karma start",
|
"test:watch": "karma start"
|
||||||
"prettier": "prettier --write ."
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/compiler-cli": "^12.2.13",
|
"@angular/compiler-cli": "^12.2.13",
|
||||||
|
@ -35,18 +32,12 @@
|
||||||
"@types/jasmine": "^3.7.6",
|
"@types/jasmine": "^3.7.6",
|
||||||
"@types/mousetrap": "^1.6.8",
|
"@types/mousetrap": "^1.6.8",
|
||||||
"@types/node": "^16.11.12",
|
"@types/node": "^16.11.12",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.12.1",
|
|
||||||
"@typescript-eslint/parser": "^5.12.1",
|
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"clean-webpack-plugin": "^4.0.0",
|
"clean-webpack-plugin": "^4.0.0",
|
||||||
"copy-webpack-plugin": "^10.0.0",
|
"copy-webpack-plugin": "^10.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.5.1",
|
"css-loader": "^6.5.1",
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
"eslint": "^8.9.0",
|
|
||||||
"eslint-config-prettier": "^8.4.0",
|
|
||||||
"eslint-import-resolver-typescript": "^2.5.0",
|
|
||||||
"eslint-plugin-import": "^2.25.4",
|
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-filter": "^7.0.0",
|
"gulp-filter": "^7.0.0",
|
||||||
"gulp-if": "^3.0.0",
|
"gulp-if": "^3.0.0",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
"name": "@bitwarden/bitwarden",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "Bitwarden Client Applications",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/bitwarden/bitwarden.git"
|
||||||
|
},
|
||||||
|
"author": "Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)",
|
||||||
|
"license": "GPL-3.0",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/bitwarden/bitwarden/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://bitwarden.com",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint . && prettier --check .",
|
||||||
|
"lint:fix": "eslint . --fix",
|
||||||
|
"prettier": "prettier --write .",
|
||||||
|
"prepare": "husky install"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.22.0",
|
||||||
|
"@typescript-eslint/parser": "^5.22.0",
|
||||||
|
"eslint": "^8.14.0",
|
||||||
|
"eslint-config-prettier": "^8.5.0",
|
||||||
|
"eslint-import-resolver-typescript": "^2.7.1",
|
||||||
|
"eslint-plugin-import": "^2.26.0",
|
||||||
|
"husky": "^7.0.4",
|
||||||
|
"lint-staged": "^12.4.1",
|
||||||
|
"prettier": "^2.6.2"
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"./!(**/jslib)**": "prettier --ignore-unknown --write",
|
||||||
|
"*.ts": "eslint --fix"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue