tighten / configs Goto Github PK
View Code? Open in Web Editor NEWStandard config files for Tighten projects
Standard config files for Tighten projects
We can't copy them exactly because some changes are specific to Duster; but I did change them to be PSR-12 instead of PSR-2, so let's import them.
Right now we only recommend prettier
:
"prettier": {
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 4,
"printWidth": 80
}
@jonsugar mentioned we may want to add some ESLint configurations in order to apply some of our other preferences, like "follow Vue's conventions".
Can we add this stuff to Prettier? Or is it only viable in ESlint? And if only in ESlint, can we move our Prettier config to ESlint so we only have one tool? Or are we stuck with two tools?
This is @jonsugar's config:
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:vue/recommended',
'airbnb-base',
],
parserOptions: {
ecmaVersion: 12,
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
plugins: [
'vue',
'@typescript-eslint',
],
rules: {
// ESLint -----------------------------------------------------------------
indent: ['error', 4],
'global-require': 'off',
'import/extensions': 'off',
'object-shorthand': 'off',
'max-len': [
'error', {
code: 120,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: false,
ignoreRegExpLiterals: false,
ignorePattern: 'class=".+"',
},
],
// TypeScript -------------------------------------------------------------
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars-experimental': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': [
'error', {
allow: ['private-constructors'],
},
],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
// Classes ----------------------------------------------------------------
'class-methods-use-this': 'off',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'max-classes-per-file': 'warn',
'lines-between-class-members': 'off',
'no-underscore-dangle': 'off',
// Vue 3 ---------------------------------------------------------------
'vue/html-indent': ['error', 4, {
attribute: 1,
baseIndent: 1,
closeBracket: 0,
alignAttributesVertically: true,
ignores: [],
}],
'vue/no-multiple-template-root': 'off',
'vue/max-len': ['error', {
code: 120,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
ignoreHTMLAttributeValues: true,
ignoreHTMLTextContents: false,
}],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
},
},
},
};
And this is one @calebporzio wrote on a project for us a few years back:
{
"extends": "plugin:vue/recommended",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
"semi": [2, "never"],
"indent": [2, 4],
"eol-last": [2, "always"],
"linebreak-style": [2, "unix"],
"vue/max-attributes-per-line": [2, { "singleline": 2 }],
"vue/html-indent": [2, 4, { "closeBracket": 0, "attribute": 1 }],
"vue/script-indent": [2, 4],
"vue/require-default-prop": 0,
"vue/require-prop-types": 0,
"vue/html-closing-bracket-newline": [
2,
{ "multiline": "always" }
]
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.