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/add biome #150

Merged
merged 3 commits into from
Jan 2, 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
12 changes: 3 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
Expand All @@ -25,9 +21,7 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
Expand Down
20 changes: 10 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"window.title": "${activeEditorShort}${separator}${rootName}"
}
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"window.title": "${activeEditorShort}${separator}${rootName}"
}
26 changes: 26 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://biomejs.dev/schemas/1.3.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignoreUnknown": true,
"ignore": ["./file-types/**"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"overrides": [
{
"include": [".vscode"],
"json": {
"parser": {
"allowComments": true
}
}
}
]
}
2 changes: 1 addition & 1 deletion file-types/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015-rollup"]
"presets": ["es2015-rollup"]
}
10 changes: 5 additions & 5 deletions file-types/.jshintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"esversion": 6,
"node": true,
"globals": {
"atom": true
}
"esversion": 6,
"node": true,
"globals": {
"atom": true
}
}
83 changes: 35 additions & 48 deletions file-types/JavaScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

*/


/*

COMMENTS
Expand All @@ -16,8 +15,6 @@

*/



/*

DOCBLOCK
Expand All @@ -29,37 +26,31 @@
*/

class Bread {

constructor(slices) {
this.slices = 12;

if ( slices > this.slices ) {
console.log('not enough bread');
} else {
console.log(slices);
}

}

constructor(slices) {
this.slices = 12;

if (slices > this.slices) {
console.log("not enough bread");
} else {
console.log(slices);
}
}
}

class Sandwich extends Bread {

constructor(slices) {
this.bread = super(slices);
this.toppings = [];
}

toppings( ingredients ) {
ingredients.forEach(function(value, index) {
this.toppings.push( value );
});
}

constructor(slices) {
this.bread = super(slices);
this.toppings = [];
}

toppings(ingredients) {
ingredients.forEach(function (value, index) {
this.toppings.push(value);
});
}
}

var Club = new Sandwich(3).toppings(['roast beef', 'turkey']);

var Club = new Sandwich(3).toppings(["roast beef", "turkey"]);

/*

Expand All @@ -71,8 +62,8 @@ var Club = new Sandwich(3).toppings(['roast beef', 'turkey']);

*/

var myName = 'Slim Shady',
template = 'Hello, my name is ${myName}';
var myName = "Slim Shady",
template = "Hello, my name is ${myName}";

/*

Expand All @@ -87,13 +78,11 @@ var Club = new Sandwich(3).toppings(['roast beef', 'turkey']);

*/


function testFunction(string,arr,obj) {
// DO SOMETHING
function testFunction(string, arr, obj) {
// DO SOMETHING
}

testFunction('one', 'two', [1,2,3], {key: 'value'} );

testFunction("one", "two", [1, 2, 3], { key: "value" });

/*

Expand All @@ -105,24 +94,22 @@ testFunction('one', 'two', [1,2,3], {key: 'value'} );

*/

import { ham as turkey } from 'mySandwich.js';
import { ham as turkey } from "mySandwich.js";

var isFunction;

switch ( typeof testFunction ) {

case 'function':
isFunction = true;
break;
default:
isFunction = false;

switch (typeof testFunction) {
case "function":
isFunction = true;
break;
default:
isFunction = false;
}

try {
testFunction();
testFunction();
} catch (e) {
throw 'Whoopsadaisy!';
throw "Whoopsadaisy!";
} finally {
console.log('i think we\'re done here!');
console.log("i think we're done here!");
}
68 changes: 33 additions & 35 deletions file-types/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import eslint from 'rollup-plugin-eslint';
import json from 'rollup-plugin-json';
import resolve from 'rollup-plugin-node-resolve';
import replace from 'rollup-plugin-replace';
import config from './shared/config.js';
import uglify from 'rollup-plugin-uglify';
import babel from "rollup-plugin-babel";
import commonjs from "rollup-plugin-commonjs";
import eslint from "rollup-plugin-eslint";
import json from "rollup-plugin-json";
import resolve from "rollup-plugin-node-resolve";
import replace from "rollup-plugin-replace";
import config from "./shared/config.js";
import uglify from "rollup-plugin-uglify";

export default {
entry: './client/app.js',
dest: '_dist/js/app.min.js',
format: 'iife',
moduleName: config.shared.name,
plugins: [
eslint({
exclude: [
'public/**'
]
}),
commonjs(),
json(),
replace({
exclude: 'node_modules/**',
ENV: JSON.stringify(process.env.NODE_ENV)
}),
resolve({
jsnext: true,
main: true,
browser: true
}),
babel({
exclude: 'node_modules/**'
}),
(process.env.NODE_ENV === 'production' && uglify())
],
sourceMap: 'inline'
entry: "./client/app.js",
dest: "_dist/js/app.min.js",
format: "iife",
moduleName: config.shared.name,
plugins: [
eslint({
exclude: ["public/**"],
}),
commonjs(),
json(),
replace({
exclude: "node_modules/**",
ENV: JSON.stringify(process.env.NODE_ENV),
}),
resolve({
jsnext: true,
main: true,
browser: true,
}),
babel({
exclude: "node_modules/**",
}),
process.env.NODE_ENV === "production" && uglify(),
],
sourceMap: "inline",
};
Loading